Jul 08, 2014, 10:30 AM
[CLOSED] Adding a new record with paging enabled issue
Hello,
I have a grid with paging tool bar. I have set pagesize ="10" in store. I am not using any remote paging here. I have a add button, which will add new empty record to the grid at the end and set the focus on second column textbox.
The problem is when I have records less than 10, a new record gets added sucessfully on Add click wth focus on second column textbox.
When there are more than 10 records in the grid, then page is more than 1 and when I click add, it adds record, but the focus is not showing up on the second column textbox.
This is the code. On add click I call this Javascript function. I am adding a new record at the last.
I have a grid with paging tool bar. I have set pagesize ="10" in store. I am not using any remote paging here. I have a add button, which will add new empty record to the grid at the end and set the focus on second column textbox.
The problem is when I have records less than 10, a new record gets added sucessfully on Add click wth focus on second column textbox.
When there are more than 10 records in the grid, then page is more than 1 and when I click add, it adds record, but the focus is not showing up on the second column textbox.
This is the code. On add click I call this Javascript function. I am adding a new record at the last.
var insertRecord = function () {
var grid = #{GridPanel1};
var count1 = grid.getStore().getTotalCount();
grid.store.insert(count1, 0);
grid.getView().focusRow(count1);
grid.getStore().update();
grid.editingPlugin.startEdit(grid.store.getAt(count1), grid.columns[1]);
};
An important thing to note is when I add a new record at the top as the first item, then it is working as expected with focus on textbox. Here, I want to add a record at the last.
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar1" runat="server" DisplayInfo="true" DisplayMsg="Displaying {0} - {1} of {2}"
EmptyMsg="No data to display" HideRefresh="true">
</ext:PagingToolbar>
</BottomBar>
Last edited by Daniil; Jul 15, 2014 at 1:04 PM.
Reason: [CLOSED]