3
« on: July 17, 2015, 04:35:35 pm »
Hello,
I am currently using local data, local header filtering and local sorting in my grid.
I want to start using remote data, remote header filtering and remote sorting and your demos show me how I can do this.
However, in addition to the ObjectModel, ColumnModel and DataModel required by pqgrid, I also use additional meta data about the rows, columns and cells that I store in JSON objects outside of the grid. This meta data is used to help render the grid (through colModel.render) and for other functionality used outside of the grid.
Question 1: If I implement a URL for handling pqGrid requests for data and filterered data, Should I use dataModel.getData and dataModel.postData so that I can include my own meta data in the request and response sent to the server?
Question 2: Other than some snippets in your demos, do you have documentation on the structure of the JSON objects sent to the server in the case of fetching paged/filtered/sorted data?
In order to use 'remote' data, I will need to create server side classes that I can deserialise the JSON from pqGrid into. This essentially couples my pqgrid code on the client to server side code in a way that is not currently done and will mean that I have to ensure that my server side code is kept up to date with future releases of pqgrid.
Question 3: I think I would prefer to be able to use a callback method to fetch data instead of having to specify dataModel.Url or dataModel.getUrl. In this way I can use my own AJAX framework to send and receive both pqgrid data as well as my own meta data and keep the pqgrid code decoupled from the server side code. Is this currently possible or will you be able to implement this in a future version of pqGrid?
Question 4: Could I use dataModel.beforeSend to intercept requests and return false. I can then get beforeSend to carry out my own call to the server and then call 'refreshView' on return. Does beforeSend have access to the JSON specifying filter and sort information?
Thanks very much