jQuery UI Widgets › Forums › Grid › Drop down list click refreshes data in grid
This topic contains 2 replies, has 2 voices, and was last updated by powen 12 years, 9 months ago.
-
Author
-
First off let me say that this product is awesome.
Unfortunately I am encountering a small problem. Allow me to explain.
I have implemented a drop down list in a grid cell. The drop down list works like it should. Here is a snippet of the code for the column in the grid:
{ text: ‘DDL’, datafield: ‘DDL’, columntype: ‘dropdownlist’, width: 50, initeditor: function (row, cellvalue, editor) {editor.jqxDropDownList({source: [“A”,”B”,”C”,”D”,”E”,”F”]});}}
However when the cell that houses the drop down list is clicked to enter edit mode the grid calls out to get a complete data refresh (JSON load via URL to a PHP page). This behavior is not witnessed on another column in the grid that houses a checkbox and another that houses a textbox.
This behavior probably wouldn’t be a bad thing in general but the grid has over 4k rows in it. So it takes some number of seconds to reload.
Does anyone have any suggestions on how to stop the grid refresh when the dropdownlist cell is clicked to go into edit mode?
thanks in advance,
Phil.
Hi Phil,
When the jqxDropDownList editor is created and initialized(this happens the first time when the user opens a cell for editing), the editor binds to the same data source as the Grid does i.e the editor uses the Grid’s source object settings. This behavior does not Refresh the Grid and does not affect its settings. If you are loading data in the Grid from a remote data source or an external file, the jqxDropDownList will make an ajax call to populate itself with data. However, this happens once, only when the editor is created. The ‘initeditor’ function is called after that initialization. We’ll consider possible options for optimization to omit the second call when the jqxDropDownList is created.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comhey thanks for the response.
When I was looking into this I set some breakpoints in my code and it was indeed calling for a data refresh on every edit mode request for the drop down list column. It wasn’t exhibiting that behavior for the other column types (text box, check box).
Regardless, I have taken steps to avoid the latency so this has become a non-issue. I moved to data arrays in local java-script variables rather than calling off to a page to get the data. unfortunately i believe that this new approach has resulted in storing the data twice on the client (once in the local variable and once in the grid objects) but oh well.
Thanks again.
Phil.
-
AuthorPosts
You must be logged in to reply to this topic.