jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Adding a new row to the grid
This topic contains 3 replies, has 2 voices, and was last updated by Dimitar 11 years ago.
-
Author
-
Hi
I am using JQ Widgets version 3.2.2
I am working on a grid which has pagination( virtual mode ) and using a CUSTOM PAGER. Data details below:
1. No of records = 200
2. Page size = 10
3. No of pages = 20I have navigated to the last page and on click of a button( which I will be showing in the screen) I will be calling the ‘addrow’ method of the jqxGrid. As there will be no space available in the last page ( which I am currently ) the grid has to add in the next page(21) ( which is not existing, but have to add at the same time when the record gets added). I am not sure if this happens automatically if I use the pager given by jqxGrid, but as I am using a custom pager I doubt it is not happening.
Can anyone please help me how to proceed with the coding(values that need to be set, methods that needed to be called in order to show the new row in the new page) to achieve the same?
Note: I will not be saving the new record immediately to the database ( if that is the case I would have called the ‘updatebounddata’ method to refresh the grid contents,pages, etc..), but I will be saving the new record on click of a save button at a later time.
Thanks
ShankarHello Shankar,
You just need to add the new record with addrow. The grid will automatically push one page and add the new row to it.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar
Thanks for your reply.
When I don’t use any custom pager ( pagerenderer property not set to any function ) then the grid is automatically adding extra page and updating the pager bar with the latest values and allowing to go to the new page.
But I am using custom pager with pagerenderer property set to a function which prepares the pager bar, in this case the grid might be adding the row to it’s internal data structure, but my custom pager bar will not be re-rendered to reflect the new values and to navigate to the new page. can you please let me know how can I re-render my custom pager once that row is added?
Thanks
ShankarHi Shankar,
Please provide us with the code of your custom pager (and grid). Remember to format the code by selecting it and clicking on the
code
button in the toolbar.Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.