开发者

Spreadsheet-like inline editing in jqGrid

开发者 https://www.devze.com 2023-01-14 01:02 出处:网络
I am using jQuery 1.4 and jqGrid 3.8 beta, Here I have used jqgrid table in which I wanted to create interface like excel sheet / spread sheet,

I am using jQuery 1.4 and jqGrid 3.8 beta,

Here I have used jqgrid table in which I wanted to create interface like excel sheet / spread sheet, where number of blank rows will already be displayed and the user can enter record into table cells the why they used to enter in spread sheet.

well I have created empty editable rows by running loop of addRowData function of JQgrid. after that I made few fields editable by specifying editable:true

now the problem is when I edit something in a field and write something after that if I move on another row then old edited data on a previous row won't get store on table it gets vanish.

here, is the live example try to type in a editable field a开发者_如何转开发nd then move to next row.

http://www.logicatrix.com/example/records.html


Your main problem is that you should change editurl: "#" to editurl: 'clientArray' (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing#saverow) if you want to use client side editing.

Moreover I recommend you remove

<script src="js/jquery.jqGrid.js" type="text/javascript"></script>

because you insert before all needed parts of jqGrid ("js/grid.base.js" and so on). You should also copy images subdirectory from the jQuery UI.Currently one recieve small errors because files like http://www.logicatrix.com/example/images/ui-bg_highlight-soft_100_eeeeee_1x100.png could not be loaded. I recommend you also use jQuery UI 1.8.4 instead of 1.8.2 till the release of jqGrid 3.8 because of some small known problems.

UPDATED: By the way a working example of client side editing you can see under http://www.ok-soft-gmbh.com/jqGrid/ClientsideEditing4.htm (use double-click and ENTER for row editing). I prepared it before for the answer How to disable auto update when jqGrid edited?. A simple change of the example will give you the code which you probably need.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号