jQGrid,如何在网格中添加新行,而不是通过模态? [英] jQGrid, how to add a new row inside the grid, not via a modal?
问题描述
某些快速搜索只会向 jQGrid $添加新行c $ c>
通过带有可编辑字段的模态弹出窗口。
Some quick searching only turns up adding a new row to a jQGrid
via a modal popup with the editable fields.
任何人都可以给我一个示例或给我看一些允许你添加一个代码的代码新的空行进入网格本身,在顶部?
Can anyone point me to a sample or show me some code that allows you to add a new empty row into the grid itself, at the top?
我在网格的最右端有一个动作列,其中 onRowSelect()
我有一个保存按钮,我可以让该按钮执行保存并刷新网格我认为..
I have an action column at the rightmost end of the grid in which onRowSelect()
I have a save button appear and I can make that button do the save and refresh the grid I think..
我无法想象如何点击添加行按钮并在顶部的网格中添加一个空行。
I can't figure out how to click on a 'Add Row' button and add an empty row inside the grid at the top.
我可以看到的一个选项是设置当前添加的样式行模态看起来像一个水平行,并将其显示为网格顶部的一行。
One option that I can see is to style the current add row modal to look like a horizontal row and place it to appear like its a row at the top of the grid.
jQGrid文档: http://www.trirand.com/jqgridwiki/
jQGrid Documentation: http://www.trirand.com/jqgridwiki/
推荐答案
如果你使用数据类型:'local'那么你可以使用 addRowData 方法,用于插入位置参数设置为'first'
的行。请参阅 http://www.trirand.com/jqgridwiki下的一些示例/doku.php?id=wiki:retrieving_data#array_data 。
If you use datatype:'local' then you can use addRowData method to insert the row with position parameter set to 'first'
. See some examples under http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data#array_data.
这篇关于jQGrid,如何在网格中添加新行,而不是通过模态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!