Tag: jqgrid

Struts2 jQuery网格数据无法加载

我是带有Struts2的JQgrid的初学者。 我尝试过这段代码但是我没有网格中的记录,但是我的所有记录都在行动中。 testGrid.jsp …… ……. testAction.java package com.sttl.rpsc.action; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; import com.sttl.rpsc.action.base.BaseAction; import com.sttl.rpsc.dataobject.Application; import com.sttl.rpsc.util.HibernateUtil; public class testAction extends BaseAction { private List gridModel; private List myCustomers; private Integer rows = 0; private Integer page = 0; private Integer total = 0; private Integer record = 0; private String sord; […]

将焦点设置为jqgrid中选定行的可编辑输入字段

在我的网格中,我使用自定义格式化程序来编辑其中一个列字段值。 我想在选择网格行时将焦点设置到该可编辑字段。 请帮帮我… 这是我的网格 jQuery(“#myGrid”).jqGrid({ datatype: “local”, colNames:[”,”,”,”], colModel:[{name:’id’,index:’id’, width:50, hidden:true}, {name:’activname’,index:’activname’, width:100, title: false}, {name:’formattedvalue’,index:’formattedvalue’, width:200, formatter:formatField}, {name:’value’,index:’value’, hidden:true}], height: window.innerHeight – 318, onSelectRow: function(id,stat,e) { // here I want to set the focus to the editable field }}); 这是格式化程序function function formatField(cellvalue, options, rowObject){ jQuery(“myGrid”).jqGrid(‘setColProp’,’formattedvalue’, {editable: true, edittype:”custom”, editoptions: { custom_element: function(value, options) { […]

jQGrid始终显示排序图标

我在jQGrid中遇到一个问题,当列名称很小并且可resize设置为false时,它不会显示排序图标。 在大型显示器中,它显示正确。 但在笔记本电脑和其他小型显示器中,它隐藏了排序图标。 我们可以包装标题,如果标题文本很大,它将与排序图标一起显示在下一行吗?

在jqGrid中呈现之前,如何修改从AJAX调用返回的数据?

背景 我从其他开发人员那里获得了一些不完整的工作,涉及显示搜索结果。 他的方法是使用内联Javascript和jQuery将结果呈现在HTML表中,如下所示。 我正在尝试完成工作,但我更愿意编写更少的代码并使用jqGrid,因为它包含排序function,并使代码更整洁。 让jqGrid显示结果很简单,但是将单选按钮放在空白列中比我想象的要难。 应用程序中jqGrid的版本是3.7.2。 网格需要在左侧有单选按钮以供选择,以使内容与应用程序的其余部分保持一致。 我被困在哪里 似乎没有办法在jqGrid中拥有未绑定的列。 也就是说,每列似乎都需要基础数据中的一个字段。 如果没有虚拟字段,则行数据和列标题将变为未对齐。 我遇到了一个示例 (请参阅行编辑 – >自定义编辑),它返回数据中带有虚拟字段的JSON,然后修改网格数据以插入按钮。 我的偏好是没有虚拟数据,因为它感觉很脏 :)我希望我的JSON只包含它代表搜索结果所需的数据。 所以我认为最好在脚本代码中添加虚拟字段,以便保持服务器端的代码清洁。 我试图在jqGrid渲染之前修改从AJAX调用返回的数据。 我已经尝试挂钩到loadComplete事件,但是当我修改数据时,它似乎已经在渲染之后。 我也尝试在options的ajaxGridOptions字段中挂钩success事件,但这似乎完全覆盖了事件,而jqGrid不呈现数据。 如何在jqGrid呈现之前修改从Web服务调用返回的数据?

如何同步jqgrid内联导航器和格式化程序操作按钮以及结束内联编辑

只有使用内联编辑向jqgrid添加新行的方法是使用jqGrid 4.3内联导航器添加按钮。 但是在这种情况下格式化程序操作保存和取消按钮不可用。 另外如Oleg评论如何将jqgrid工具栏中的切换按钮添加到自动生成的上下文菜单(如果已选择其他行并终止内联编辑),则行仍处于编辑模式。 如何同步格式化程序actons和在线导航按钮:按下添加,在工具栏中编辑或编辑格式化程序操作按钮或双击行开始在线编辑。 两个地方的保存和取消按钮终止在线编辑。

如果从高级搜索对话框中删除行,如何清除工具栏中的filter值

如果从高级searxh对话框中删除它们,则自由jqgrid不会清除filter工具栏中的值。 要重现,请打开高级searcg对话框 http://www.ok-soft-gmbh.com/jqGrid/OK/formEditOnDoubleClick-jqueryui-fa-bootstrap.htm 通过单击减号按钮删除这两个条件按下查找按钮后,搜索工具栏仍然包含这些值。 怎么解决这个问题?

如何在最新的免费jqgrid中修复filterToolbar中的exception

使用创建Jqgridfilter工具栏 $(function () { $grid.jqGrid(‘filterToolbar’, { // this is line myapp.js:797 in stack trace below stringResult: true, searchOnEnter: true, defaultSearch: ‘cn’ }); }); 使用来自github的最新jqgrid会导致filterToolbar出错: Uncaught TypeError: Cannot read property ‘toUpperCase’ of undefined url http://localhost:52216/admin/Scripts/jqgrid/js/jquery.jqgrid.src.js lineNumber 8924 column 24 如何解决这个问题? 堆栈跟踪如下。 TypeError: Cannot read property ‘toUpperCase’ of undefined at parseFilter (http://localhost:52216/admin/Scripts/jqgrid/js/jquery.jqgrid.src.js:8924:24) at HTMLTableElement. (http://localhost:52216/admin/Scripts/jqgrid/js/jquery.jqgrid.src.js:9255:23) at Function.jQuery.extend.each […]

jqGrid表单编辑选择顺序

我有一个来自编辑页面的jqGrid,其中包含一个select,已经设置了选项。 问题是在不同的浏览器中排序是不同的。 Firefox和某些版本的Chrome将原始排序(原始排序是按选项内容)更改为按选项排序的值。 这是JavaScript代码: jQuery(‘#jqgridDM’).GridUnload(); jQuery(‘#jqgridDM’).jqGrid({ ‘url’: ‘/sco-intra/dichiarazioneM/jqgridlist/362.html’, ‘datatype’: ‘json’, ‘mtype’: ‘POST’, ‘colNames’: [‘Deposito’, ‘Societa Propr Prodotto’, ‘Prodotto Lib’, ‘Quantita’], ‘colModel’: [ { ‘name’: ‘deposito_id’, ‘index’: ‘deposito_id’, ‘width’: ‘100’, ‘editable’: true, ‘edittype’: ‘select’, ‘editoptions’: { ‘value’: { ‘242’: ‘11009 – LUDOIL (DARM PETROLI) – NOLA’} }, ‘formoptions’: { ‘label’: ‘Deposito’} }, { ‘name’: ‘societa_propr_id’, ‘index’: […]

如何在jqgrid中更改CellSelect事件中的图像?

我遇到了麻烦,因为在jqgrid的onCellSelect事件中我想要更改单元格的图像,例如,一旦我在单元格内部单击,我想要更改图像,如下所示: ,我归档的唯一东西一旦每个单元格中的网格加载加载图像,它就会改变: 这是我在网格中加载img的代码: {display: ”, name : ”, formatter: image} function image(cellvalue, options, rowObject){ if(rowObject[5]== 1){ return “”; }else{ return “”; } } 和我的方法 onCellSelect: function() { id = $(“#list2”).getGridParam(‘selrow’); }, 我怎样才能在onCellSelect上改变每个单元格的img?

如何使用“reccount”在jqGrid中隐藏和显示自定义按钮

我正在尝试使用隐藏和显示function在jqGrid上实现自定义按钮。 我基本上想要显示按钮,如果网格是空的,否则显示。 我用jqGrid中的“reccount”方法实现了它,以测试网格是否为空。 但是我不确定我是否正确行事。 到代码的末尾是我声明reccount的地方。 见“var count”。 提前致谢。 $(“#sessioninfoGrid”+row_id).jqGrid({ url:’/starburst/sessioninfoes/jsonlistbylectureoutline/’+row_id, datatype: “json”, colNames: [‘Session No.’,’Date’,’Start Time’,’End Time’,’Duration/Hours’,’Session Type’,’Topic’,’Room’], colModel: [ {name:’sessionNumber’,index:’SessionNumber’, width:40, formoptions:{elmprefix:'(*) ‘}, editrules:{required:true}, editable:true, edittype: ‘text’}, {name:’sessionDate’,index:’sessionDate’, width:100, formoptions:{elmprefix:'(*) ‘}, editrules:{required:true}, editable:true, edittype: ‘text’, editoptions: { dataInit: function(element) { $(element).datepicker({dateFormat: ‘DD, MM dd, yy’}) } } }, {name:’starttime’,index:’starttime’, width:50, formoptions:{elmprefix:'(*) ‘}, editrules:{required:true}, editable:true, […]