且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在jqgrid中添加第二行

更新时间:2023-12-05 13:08:34

可以在列标题上方创建网格的两个标准元素:标题(网格标题)和顶部工具栏(有关示例图片,请参见此处) .这两个标头都可以保存任何包含<br/>的公共HTML数据.

There are two standard element of grid which can be created over column headers: caption (grid header) and top toolbar (see here for pictures with examples). Both the headers can hold any common HTML data inclusive <br/>.

可以通过使用非空的caption参数创建初始字幕.您可以随时使用 setCaption 方法进行更改.

Initial caption can be created by usage non-empty caption parameter. You can change it at any moment using setCaption method.

要创建顶部工具栏,应包含toolbar: [true, "top"]选项.它将在网格标题上创建其他div. div具有类"ui-userdata"和基于网格ID构造的ID:"t _" + grid_id.如果需要在div中放置多行信息,则应覆盖默认CSS.参见答案这一个以了解更多详细信息和代码示例.

To create top toolbar you should include toolbar: [true, "top"] option. It create additional div over the grid header. The div have the class "ui-userdata" and the id constructed based on the id of the grid: "t_" + grid_id. If you need to place multiline information in the div you should overwite default CSS. See the answer, this one and this one for more details and code examples.