This is a migrated thread and some comments may be shown as answers.

Filter menu cleared after datagrid reload

3 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Petronio Spyer
Top achievements
Rank 1
Petronio Spyer asked on 15 Jan 2014, 03:36 PM
I have a kendo grid that must refresh every 2 seconds to show the new rows added to my list of json objects. This is done by datasource.read(). This grid allows filter through the context menu (columnMenu), but the user can't write text in the filter's menu because the grid is reloading every second (datasource.read()).  In other words, when the user inputs some value in the menu's textboxes, the textboxes are cleared after refresh.

Is there any way to avoid to clear the text while the user is writting?
I try to add an "event listener" on the texts boxes to get the its values and fill it after datagrid's reload, but i don't know which column the text box is..  Is there any solution? Here is a demo: http://jsfiddle.net/3qT3J/2/
Thank you.

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 16 Jan 2014, 12:36 PM
Hello Petronio,

Thank you very much for the provided example.

When the dataSource is read the Kendo UI Grid redraws again, so this behavior is expected. I am afraid that there is not a built-in feature that you can use in order to workaround this. What you can do is to create a form outside of the grid that will not be refreshed, where users can enter their filters and then you manually construct the filters and apply them to the dataSource.

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Petronio Spyer
Top achievements
Rank 1
answered on 16 Jan 2014, 02:33 PM
Hi Kiril, thank you for your solution. As a workaround , I added event listener on the filter menu so  while the mouse is on the menu, the datagrid doesn't not be refreshed and when the mouse get out of the menu, the data grid is refresh, Example:
     $('form.k-filter-menu').mouseleave(function(e) {
       // start datagrid.read
       intervalReadDataGrid= setInterval(datagrid.read, 2000);
    }
    $('form.k-filter-menu').mouseenter(function(e) {        
       // stops datagrid.read
      clearInterval (intervalReadDataGrid);
    }
Has anyone have another solution?
0
Kiril Nikolov
Telerik team
answered on 17 Jan 2014, 09:05 AM
Hi Petronio,

You solution seems perfectly valid and seems to do the job. In case you have any further questions, please do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Petronio Spyer
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Petronio Spyer
Top achievements
Rank 1
Share this question
or