问题标签 [struts2-jquery-grid]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
419 浏览

jsp - 将自定义文本添加到 Struts2-jQuery-Grid 中的 jqGrid 导航器按钮

我正在使用 struts2 jqGrid。我已启用navigatorSearch="true". 所以它显示了搜索按钮。我想在按钮上添加一个文本,说我在这里Search读到了我需要添加属性来添加自定义文本。但我不知道在哪里添加这个属性。我尝试添加它,但它失败了。这是我的(部分)网格代码:searchtextnavigatorSearchOptions

如何将文本添加到搜索和重新加载按钮?提前致谢。

0 投票
0 回答
378 浏览

struts2 - 自定义Struts2 jquery网格列的tooltip

我是 usimg struts 2 jquery 网格。在鼠标悬停时,它会显示该特定列中数据的工具提示。但不是那样,我希望整行显示基本细节的相同工具提示,即。该特定行的所有列的详细信息。任何人都可以帮助我如何去做吗?提前致谢。

0 投票
1 回答
952 浏览

struts2 - struts 2 jquery grid plugin 只改变一个列标题样式

是否可以更改网格中只听到一列的样式?!

sjg:gridColumn一个cssClass属性,但是设置这个 css 只会应用于列下的行,而不是列标题。

JQGRID - 是否可以在 JavaScript 中更改 HTML 标题文本的背景颜色?我得到的代码如下:

在您的 HTML 页面中。如果您只想对一列进行更改,您可以使用 setLabel 方法:

$("#myGrid").jqGrid('setLabel','Price', '', {'background':'red'});

或者

$("#myGrid").jqGrid('setLabel','Price', '', 'myColorClass');

但我无法让它工作。

最后,由于列标题将具有唯一的 ID,我可以在下面使用:

那么你认为有更好的方法。我一直在寻找这样的东西:

在我的 CSS 中

哪个不起作用,只更改行 css 而不是列标题。

我还发现gridColumn有一个formatoptions可以做我正在寻找的东西吗?!

0 投票
1 回答
373 浏览

jquery - struts2 jqGrid 列的工具提示

我必须在 jqGrid 的第一列中添加一个自定义工具提示。就像这个答案一样。

但问题是我无法在我的网格列中实现它

请建议我如何将其添加到 $.subscribe('loadComplete', function(event, data) {} 感谢中。

0 投票
0 回答
200 浏览

jquery - 列标题打开对话框的链接

我无法创建子网格列标题作为指向另一个窗口的链接。

这是我的代码示例:

  1. 要求:我需要将突出显示的项目作为超链接打开到一个新的对话框等窗口。sjg:gridcolumn提供非常有限的选项。

  2. 我的方法:我尝试过获取标题位置。我也无法通过其 ID 获取标题。

这是我想要实现的目标的图像。
网格

0 投票
0 回答
318 浏览

jquery - Struts 2 jquery grid 编辑对话框问题

我在 Struts2 jquery 网格插件中面临一个问题:

  • 如果我单击add网格面板上的导航器按钮,则add对话框打开得很好,但是add当我单击edit按钮后单击...相同的add对话框再次打开。

  • 如果edit先单击按钮edit,则打开对话框,单击按钮后,edit如果单击,add则打开相同edit的对话框。

为什么edit/add 不刷新?

下面是我的代码:

0 投票
1 回答
461 浏览

struts2 - jqgrid .trigger('reloadGrid'); 不适用于多个网格

我有一个预先填充了数据的 jqgrid。单击任何行将发送 4 个 ajax 请求以获取详细信息(加载 4 个 jsp 页面)。3 页中有新的 jqgrids。

我在第一个网格(jsp 页面)上有一个外部搜索和清除选项。它可以正常工作任何 # 次。但是一旦我用网格获取其他页面,搜索和清除就不起作用了。当然,脚本正在执行,但不是触发器。

我确实看到了一些解决方案,并且已经应用​​了所有但无济于事。

网格 1:

下面是 rowselect 的订阅代码。

我只展示了一个 ajax 调用,同样还有 3 个调用可以获取其他网格。

现在搜索代码

如前所述,上面的代码一直都可以正常工作,但是当获取其他网格时,它不会触发重新加载!!!

0 投票
1 回答
1066 浏览

jquery - Struts2 Jquery jqGrid beforeShowForm 示例

我正在寻找一种在 struts2-jquery 网格上打开编辑对话框时使用 beforeShowForm 事件的方法。我希望能够将自定义字段添加到编辑对话框。

但是,我在理解如何使用带有 sjg 标签的 beforeShowForm 事件时遇到问题。我已经搜索了几天的解决方案,但所有这些似乎都只在使用常规 jqGrid 而不是 sjg 标签时才出现。大多数示例似乎都引用了 jqGrid wiki,但我还是不明白访问该事件的方式。有人可以给我一个在 sjg 标签内的编辑按钮上为 beforeShowForm 分配函数的示例吗?

谢谢

0 投票
1 回答
1096 浏览

jquery - Struts2 jqGrid 删除单个列过滤器上的 x

我有一个带有列过滤器的网格的 struts2-jquery jqGrid 页面。一些列是日期格式,我不想显示,所以我使用 .hide() 删除了该列过滤器的输入字段。

但是,我刚刚隐藏的字段旁边还有一个小“x”。下面是显示列字段的 html。

有多个 td 标记,其中 class="clearsearchclass" 所以我需要包括选择 colindex=8(从 td 标记向上几行)来指定这个特定的列。

我需要使用什么选择器来获取这个特定的 td 标签?或者有没有更好的方法来隐藏单个过滤器和“x”?

谢谢你的帮助

0 投票
1 回答
354 浏览

jquery - Struts2 jqGrid Bind afterclickPgButtons to Edit Dialog

I have a struts2-jquery jqGrid page with a grid that uses the event dialog boxes. I'm trying to bind the event afterclickPgButtons to the edit dialog. I can bind events to the entire grid (gridTable), but I'm having issues binding the event to the dialog box. I want to modify the contents of elements AFTER the edit dialog info changes when using the next/prev button inside the edit dialog.

I'm trying to run the below inside the loadComplete and bind to jqGridAddEditAfterShowForm thinking I need to do the final bind after the page loads and after the form is displayed.

However, the code above seems to be cumbersome and the bind to afterclickPgButtons does not work. How do I get the afterClickPgButtons to workAny help is greatly appreciated.