问题标签 [jqgrid-asp.net]

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 投票
1 回答
8637 浏览

jqgrid - 更改 JqGrid 列的顺序

我想动态更改网格列顺序。例如,默认情况下,网格将按 LoginId、FirstName 和 LastName 顺序加载。根据某些情况,我需要更改 FirstName 和 LastName 序列。

有什么办法可以做到这一点吗?

我试着这样做:

但我无法完成这项工作。

0 投票
0 回答
1033 浏览

asp.net-mvc - jqGrid trigger("reloadGrid") in ASP.NET MVC not firing

I'm not sure how to use trigger("reloadGrid") to refresh a jqGrid. I've tried many things, but none of them will get trigger to fire. I have a grid I created through ASP.NET using the MVC DLL from jqGrid.

Now I'm attempting to change the grid onload of the page.

The trigger does nothing; however if I click the reload grid icon on the grid itself then my new rowNum setting is applied. How do I force the grid to auto-refresh (or more accurately "display") the settings I apply to it?

0 投票
2 回答
6386 浏览

asp.net-mvc - 在 Asp.Net MVC 中将命令列添加到 jqGrid

我希望你早上好。

我想在我的 Asp.Net 应用程序中使用 jqGrid。到目前为止,我一直在生成一个 html 表并将其转换为网格,但我想尝试一种更好的方法:通过 AJAX 调用加载数据,因为它应该与网格一起使用。我发现了如何获取数据,但除了数据列之外,我还想要“编辑”和“删除”列。我如何实现它?

我宁愿不为我的控制器中的按钮制作 html。理想的解决方案是只发送数据,并让 jqGrid 根据一些客户端模板和 id 值添加所需的列。我无法手动执行此操作,因为我无法将列添加到现有网格。那么,我该怎么办?

更新。我不需要仅仅实现编辑/删除功能。我需要的是根据一些模板和“id”值添加一个带有 HTML 的列,比如<a href="MoreDetails/{id}">[More details]</a>

0 投票
2 回答
770 浏览

javascript - Need to override Search Filter url param (_search) in jgrid the jquery plugin?

Hi I have created a user message page with this plugin. The grid will show the user inbox and the user outbox(sent) messages. here's a little code:

so then when the user clicks on outbox something like this happens:

it working all great until I use my search filters. for example I search for the messages sent from the user 'foo' and it's all good but when I click on outbox it will still try to show me messages sent by the user 'foo' but I want the search filters to be reset.

I tried loading the search dialog on document ready and closing it immediately to get the filter().reset and all that but it doesn't work :the-built-in-search-filter-box

myGrid.trigger('reloadGrid'); has the same behaviour as well

would fix my problem but it won't override the _search param.

any generous suggestions?

0 投票
1 回答
9793 浏览

jqgrid - 在jqgrid上更改rowId?

我有一个包含一些数据的 jqgrid,其中第一列是数据库中的数字 PK。

当我的 delete 方法被调用时,它会传入网格的 rowId(它应该这样做)。但是,我的后端不知道哪一行上有什么数据。有没有办法可以将行 ID 设置为我的 PK 字段?或者有没有办法强制它在删除时传递PK值而不是行ID?

谢谢

0 投票
3 回答
8392 浏览

jquery - jqGrid中的工具栏?

我想在 jqGrid 中创建一个工具栏,其中只有通常在寻呼机上的按钮。

目前我有以下定义

我需要添加其他功能,如“CSV 导出”、“PDF 导出”、“打印”等...

事实证明,空间将被填满,我想移动顶部工具栏中的按钮,同时在底部仍然有带有导航器的寻呼机和记录计数信息。

是否可以使用 jqGrid 实现此配置?

0 投票
2 回答
87925 浏览

jqgrid - jqGrid 和 autowidth 选项。它是如何工作的?

我正在使用 jqGrid 并将autowidth选项设置为true.

根据文档

设置为 true 时,网格宽度会自动重新计算为父元素的宽度。这仅在最初创建网格时完成。为了在父元素更改宽度时调整网格大小,您应该应用自定义代码并为此使用 setGridWidth 方法

这使得网格占据了父元素中所有可用的宽度。此属性的另一个效果是每列都会缩小以适应可用的宽度。

这很好用。但是,我有一页不希望列缩小以适应网格宽度,但它们应该占据我colModel为它们设置的空间。

我怎样才能做到这一点?

0 投票
1 回答
10654 浏览

jquery - 具有编辑/删除行为的 jqGrid 自定义按钮

我在 jqGrid 中使用自定义编辑/删除函数,我真的很喜欢他们在检查是否选择了一行之后调用您的自定义函数。

Now I would like to add two more buttons and I would like to use the same behaviour of the edit/delete, so when a row is selected my function get called but if no rows have been selected they show the default popup that says "please先选择一行”。

有没有办法做到这一点?或者,有没有办法调用网格本身调用的方法?

谢谢!

0 投票
2 回答
20720 浏览

asp.net - jqGrid:使用多种方法过滤数据

我的要求是显示一个包含多个过滤器的页面以应用于网格数据。

假设我们正在谈论订单并且订单具有以下属性

在 jqgrid 对象中,我显示了除 OrderStatus 之外的所有属性

要求是创建一个具有

  • 左侧的 jqGrid
  • 右侧的面板

在右侧面板中,用户将看到代表每个可能的 OrderStatus 值的复选框列表,并且他希望使用这两种方法进行搜索(例如选择复选框“已发货订单”,然后使用大于某个值的金额过滤网格)

我已经multiplesearch:true在 jqGrid 对象中配置了高级过滤 ( ),并且能够创建组合字段和逻辑运算符的复杂过滤器。

当用户按下搜索按钮时,关于如何从右侧面板提交数据的任何想法?

更新 1

序言:奥列格样品很棒,但不幸的是不符合我客户的要求:(

@Oleg:我不明白你为什么这么认为:

如果数据在网格之外,您将仅在右侧窗格中显示所选行的订单详细信息。因此,用户将无法很好地概览数据。

也许我的描述不是很清楚,但我不会显示任何订单细节。为了更好地阐明我的要求,我修改了您的示例,以向您展示所需的最终 UI,如下图所示: 客户想要的 UI

客户希望使用两种方法或同时使用两种方法来过滤网格中的数据:

  • 使用multiplesearch网格本身提供的设施(感谢提到的解决方法)
  • 使用提供的自定义搜索面板(右侧带有复选框的那个)

从功能的角度来看,需求很容易表达:当用户单击复选框或使用本机进行搜索时,multiplesearch我应该将值发布到服务器,包括复选框状态。

总结一下,我应该:

  • 当通过本机发布帖子时添加复选框状态multiplesearch
  • multiplesearch当用户单击复选框时添加当前状态(如果有)

有没有办法做到这一点?

0 投票
2 回答
2242 浏览

jquery - jqGrid列冻结

我一直在使用Trirand 的 jqGrid和 ASP.NET MVC3 以及 jquery.jqgrid 插件。

我已经读到,列冻结功能尚未实现,正在等待投票。但是现在,与等待该功能相比,我想深入研究可能的解决方法。有人知道或建议一种方法来解决这个问题吗?

非常感谢您提前提供的信息。