Hello,
I understand how the DataSource.read() functionality works; I send a JavaScript plain object and the parameters and values are sent to the server. That all works well. I also understand how the data object works under the read transport; that won't work in this instance, because the ViewModel that has the data I need upon search isn't created until after the DataSource itself. I don't want to use require.js if I don't have to :)
But, what if I have a DataSource that has server paging (I use the skip and take parameters on the server to process the request) and I send a plain object when I read? How do I persist the query parameters after I go to the next page in a Data Grid?
For instance:
*** DataSource ***
var rfqDataSource = new kendo.data.DataSource({
schema: { model: { id: "RFQ" }, data: "RfqQuotes", total: "total" },
transport: { read: { url: window.rfqQuotePath, dataType: "json" } },
serverPaging: true,
pageSize: 15
});
*** Call to read the datasource after a search button is clicked ***
rfqDataSource.read({ customer: rfqModel.customer, startDate: rfqModel.startDate });
The Grid that is bound to the DataSource filters correctly, but as soon as I go to the next page, the read parameters are lost. Better yet, if I'm on page two of the Grid before I do a search, and do the search, the Grid may show no results at all depending on how many pages of actual data are returned.
So, I want to be able to send parameters to the API and persist those parameters until I search again or clear the search parameters.
I understand how the DataSource.read() functionality works; I send a JavaScript plain object and the parameters and values are sent to the server. That all works well. I also understand how the data object works under the read transport; that won't work in this instance, because the ViewModel that has the data I need upon search isn't created until after the DataSource itself. I don't want to use require.js if I don't have to :)
But, what if I have a DataSource that has server paging (I use the skip and take parameters on the server to process the request) and I send a plain object when I read? How do I persist the query parameters after I go to the next page in a Data Grid?
For instance:
*** DataSource ***
var rfqDataSource = new kendo.data.DataSource({
schema: { model: { id: "RFQ" }, data: "RfqQuotes", total: "total" },
transport: { read: { url: window.rfqQuotePath, dataType: "json" } },
serverPaging: true,
pageSize: 15
});
*** Call to read the datasource after a search button is clicked ***
rfqDataSource.read({ customer: rfqModel.customer, startDate: rfqModel.startDate });
The Grid that is bound to the DataSource filters correctly, but as soon as I go to the next page, the read parameters are lost. Better yet, if I'm on page two of the Grid before I do a search, and do the search, the Grid may show no results at all depending on how many pages of actual data are returned.
So, I want to be able to send parameters to the API and persist those parameters until I search again or clear the search parameters.