The first time I init the grid, I’m able to navigate using keyboard, but after the “clear and load” instruction, the grid doesn’t allow to navigate using keyboard.
I have tried adding this sentence:
grid_1.enableKeyboardSupport(true);
But it doesn’t work.
How can I mantain filters after the operation of “clear and load” ?
Unfortunately the issue with the keyboard problem cannot be reproduced locally.
Could you please, share with a demo link or a complete demo, where the problem can be reconstructed.
You may try to use the following solution to restore the filters after the data reloading.
val=myGrid.getFilterElement(ind).value; // save value of the required filter input
myGrid.clearAndLoad(url,function(){//reload data
//aftercall
myGrid.getFilterElement(ind).value=val //set the saved value to a filter input back
myGrid.filterByAll(); //force the filter procedure
});
it was an error in the code … you should use myGrid.getFilterElemet(inde) before and after clear and load
val=myGrid.getFilterElement(ind).value; // save value of the requitred filter input
myGrid.clearAndLoad(url,function(){//reload data
//aftercall
myGrid.getFilterElement(ind).value=val //set the saved value to a filter input back
myGrid.filterByAll(); //force the filter procedure
});
I apologize. paul.sas is right.
It was a mistake in my suggested code.
there is no setFilterElement() function. You should use the getFilterElement() function.
I attached a URL, where you can see my 2 problems:
Once I click on “New customer” button, and I add “surname”, “name”, “email” and click on Save button, then grid doesn’t display the new value until y refresh the page manually.
Also when “New customer” pop up is closed , I cannot navigate through grid using the arrows of my keyboard.
Once I click on “New customer” button, and I add “surname”, “name”, “email” and click on Save button, then grid doesn’t display the new value until y refresh the page manually.
This is the expected behavior as you are adding the record directly to the datastore but not to a dhtmlxGrid.
So you need to refresh the grid data. But it should be performed after the data is completely updated in the datastore. This moment can be controlled with the onStoreUpdated event: docs.dhtmlx.com/api__datastore_o … event.html
Also when “New customer” pop up is closed , I cannot navigate through grid using the arrows of my keyboard.
Please, try to call the myGrid.setActive(true) method after the pop-up is closed: docs.dhtmlx.com/api__dhtmlxgrid_setactive.html
Point 2 doesn’t work.
It’s strange because months ago I did a similar web but using different Skin (skyblue) and It works with the same code that I’m using now.