In jqGrid, one can set sortableRows to true to enable drag-and-drop row with local data. Is it possible to remember/persist row position even after a page refresh? I know it's possible to save column position with localStorage. How about the rows?
Related
I am using SlickGrid with the checkbox selector plugin and the pagination plugin. I want to only allow the user to select rows for the current page. I noticed that slickgrid remembers values that the user selects on a previous page. Only when a user selects a row on the current page does it uncheck the rows on a previous page. Is it possible to uncheck all rows on a page change event.
Similarly if the user does a search I want to unselect all rows.
Same with sorting, unselect all rows for the grid when the user does a sort.
Is it possible to do this?
The checkbox selector plugin was not designed for pager. Whenever you set checkbox as selected using the plugin, it remembers the row indices _selectedRowsLookup of the grid and re-apply the formatting when the grid invalidates. Thus, it will be the same rows check/unchecked on each page.
To achieve what you want, you have to customize the plugin where you need to:
Add a flag/field isSelected to your dataset that store if a record is selected
Set the formatter to check the dataContext.isSelected instead of using the _selectedRowsLookup
Change the handleSelectedRowsChanged to modify the field isSelected to true or false with the correct reference on the current page.
To select the rows of current page, change handleHeaderClick to only modify the rows displayed using the current pagingInfo
To clear the selection, reset the isSelected field to false and invalidate the grid rows.
when I login for the first time on my page I view the information in staggered rows in the table (rich:dataTable). As soon as I step just with the mouse pointer on these areas, the text in the cells goes to occupy its correct position.
I see the text in the header of the columns hidden by filters that are below (the correct position is on top of the filters) and a few rows back off the table but on mouse hover are shown automatically in the correct position of the row in the table.
Can you help me to solve this problem? I use RichFaces 4.3.7 and IE8.
Thanks
I have a slickgrid table that I refresh with new data every couple of seconds. If set enableTextSelectionOnCells to allow the user to select text in a cell, currently the selection is removed when the table refreshes.
Is there a way to persist user cell-selection during a grid.setData(newData) call?
you can use goToCell after setting data as follows,
grid.gotoCell(row, cell, forceEdit);
grid.gotoCell(0, 0, true); // it will take you the 1st row and 1st cell and will make it editable.
Use dataView.syncGridSelection(grid, true);
dataView.syncGridSelection(grid, true); function will preserve the row selection even after adding new row to the grid. Later U can check for the active cell and make it active Try it
I'm using slickgrid 2.1 and successfully using a formatter for one of my columns in order to display a button that, when clicked, deletes the corresponding row from the grid.
My requirements and question: I need to only display this button in the row the user single-clicks on. When the user clicks one row, then another, the button from the first selected row needs to be hidden and the button on the second selected row needs to be displayed. How can I programmatically do this?
Many thanks.
I'm using jqgrid with inline editing , when the user gets to the last cell inside a row , when he clickes on "tab" key he will be editing the next row - and if it does not exist a new row will be created.
I want to add a delete row function for the user , but still to have that row data inorder to send it later to the server as a deleted row.
I tried hiding the row , but then when the user "tabs" to the next row - it goes to the hided row - and i want it to go only to the not hided rows.
Is there a way to mark a row as deleted? and then when I generate the xml from the grid rows it will be a part of those rows? or is there a way to delete the row and save it's cells values , and be able to navigate throgh the grids line without going throgh the deleted line?
Any help will be appritiated!
Thank's In Advance.
To fix problem with editing of hidden row you can try to add class "not-editable-row" to the row which you hide.
$("#"+rowid).addClass("not-editable-row").hide();
If it will not help you will have to overwrite the default "TAB" behavior of jqGrid (see the question for implementation details)
Probably more easer way would be to use delRowData which delete a row from the grid without sending any information to the server. If you want to have your custom implementation of the "Delete" button in the navigator (see the example here). Inside of your onClickButton event handler you can save the contain of rows, which will be deleted, to some JavaScript array/object and then delete the row with respect of delRowData. So you can trace all delete operation, save deleted rows and send later all needed informations to the server.