使用 jqGrid 更改添加表单的 CSS

2022-01-19 00:00:00 jquery javascript css jqgrid jquery-ui

我想更改 CSS 的添加表单的 jqGrid.是否有任何方法可用于更改 jqGrid 的添加表单链接中的完整 CSS?

I want to change the CSS of the add form of the jqGrid. Are there any methods available for changing the complete CSS in the linking of the add form for the jqGrid?

我想为添加表单导入另一个 CSS 文件并申请该添加表单.

I want to import another CSS file for the add form and apply for that add form.

推荐答案

你可以找到所有使用 jqGrid 的 CSS 样式来添加/编辑表单 这里和这里.如果您检查这些行并检查任何 jqGrid 表单的 HTML 片段,您会看到 jqGrid 使用的所有类.

All CSS styles which uses jqGrid for the add/edit forms you can find here and here. If you would examine the lines and examine the HTML fragment of any jqGrid form you would see all classes used by jqGrid.

我不明白你在导入另一个css"下的意思.只有当您在某个地方有其他 CSS 样式具有相同的类名和相同的元素层次结构(潜水、表格、tr 等元素)时,导入"才会起作用.所以jqGrid使用的表单样式是可以改变的,但是样式的调整就不那么容易了.您必须准确检查 jqGrid 对话框(表单)的结构才能进行更改.

I don't understand only what you mean under "to import another css". The "import" would works only if you have somewhere another CSS styles with the same class names and the same hierarchy of the elements (dives, tables, tr and so on elements). So it's possible to change the styles of forms used by jqGrid, but the adjustment of the styles will be not so easy. You have to examine the structure of the jqGrid dialogs (forms) exactly to be able to make the changes.

更新: jqGrid 使用 jQuery UI 样式.因此,您只需将 jQuery UI 更改为另一个,jqGrid 就会使用它.

UPDATED: jqGrid uses jQuery UI styles. So you need just change the jQuery UI to another one and jqGrid will use it.

例如demo(对旧demo的简单修改来自答案)生成以下编辑表单:

For example the demo (simple modification of the old demo from the answer) produce the following Edit form:

相关文章