简体   繁体   中英

jqgrid delete row only on screen and save the deleted row

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM