Tag: jqgrid

如何强制jqgrid使用查询字符串中的OData查询数据

免费的jqgrid使用读取远程json数据 $.jgrid.useJSON = true; $.extend(true, $.jgrid.defaults, { mtype: ‘GET’, url: ‘@Html.Raw(Url.Action(“Entity”, “API”,))’ } ); 搜索窗口是使用定义的 $.extend(true, $.jgrid.search, { multipleSearch: true, recreateFilter: true, closeAfterSearch: true, overlay: 0, recreateForm: true }); 如果按下搜索按钮,则会创建丑陋的filter查询字符串参数 http://localhost:52216/admin/API/Entity/DoklstlG?search=true&nd=1448746804617&rows=20&page=1&sidx=customer&_sord=desc&filters=%7B%22groupOp%22%3A%22AND%22%2C%22rules%22%3A%5B%7B%22field%22%3A%22Klient_nimi%22%2C%22op%22%3A%22cn%22%2C%22data%22%3A%22a%22%7D%5D%7D 如何更改此url,尤其是以OData格式生成的filters子句? 我阅读了jqgrid OData插件wiki文章,但还没有找到这种可能性。

如何停止Jqpivot的自动排序?

以下jqpivot网格显示汽车租赁的销售信息。 完整的代码是在jsfiddle中 var data = [{ “id”: 1, “make”: “toyota”, “model”: “corolla”, “fuelusagecity”: “17”, “fuelusagehwy”: “12”, “fuelmeasure”:’Litre’, “salesaboveavg”: false, “totalnumberofsales”: 120000.0000, “highsalestext”: null, “salesdate”: “2010-12-01” }, { “id”: 2, “make”: “toyota”, “model”: “corolla”, “fuelusagecity”: “10”, “fuelusagehwy”: “14”, “salesaboveavg”: false, “fuelmeasure”:’Litre’, “totalnumberofsales”: 100000.0000, “highsalestext”: “HIGH”, “salesdate”: “2010-12-15” }, { “id”: 3, “make”: “toyota”, “model”: “belta”, “fuelusagecity”: […]

如何在使用内联编辑时在jqgrid中发布静态值

我想发一个静态值给服务器,像这样<input type="hidden" name="table_name" value="”>这个值不是colmodel的一部分,我想要每当内联编辑发生时发布它,这是我的jqgrid的php文件, var lastsel2 var mydata=; jQuery(“#rowed5″).jqGrid({ postData: {test_value:”}, serializeCellData: function( post_to_server ) { var postParams = jQuery(“#rowed5”).jqGrid(‘getGridParam’,’postData’); if(postParams.hasOwnProperty(‘test_value’) ) { post_to_server[‘test_value’] = postParams.test_value; } return post_to_server; }, datatype: “local”, shrinkToFit: false, data: mydata, height: 320, autowidth:true, colNames:[‘RowID’,’status’,’note’,’Variant ID’], colModel:[ {name:’id’,index:’id’, width:55, sorttype:”int”,align:”center”}, {name:’status’,index:’status’, width:150,align:”left”, editable: true, edittype:”select”,editoptions:{value:”Exclude:Exclude”}}, {name:’note’,index:’note’, width:200, sortable:false,editable: true,edittype:”textarea”, editoptions:{rows:”2″,cols:”10″}}, […]

在双击期间阻止行变为可编辑 – jqGrid

我们的是一个Struts2-jQuery Grid实现,它类似于jqGrid。 我们已经将我们的网格作为 multiselect=”true” and editinline=”true” 我们在每行的数据中添加了“自定义编辑”按钮,并希望该行只能通过它进行编辑。 我们删除了“编辑”的导航栏/工具栏图标。 目前,即使在双击行时,数据行也可以编辑。 我们能够捕获事件,但如何取消行动? 我们尝试返回false,停止..但它们没有用。 我们甚至尝试过stop.propogation,但仍然可以编辑行。 我们怎么能阻止这个?

未执行排序时显示jqGrid排序图标

在我们的网格中,我们没有定义sortName或sortOrder但第一列显示了排序图标(按ASC顺序)。 如何防止排序图标出现? 更新 :以下代码 $(“#list”).jqGrid({ url:’NoData.json’, datatype: ‘json’, mtype: ‘GET’, colNames:[‘Product’, ‘Type’,’Expiry’, ‘Put Call’, ‘Strike’, ‘Account’,’Long’,’Short’, ‘Open Qty’, ‘LTD’, ‘Operations’], colModel :[ {name:’product’, index:’product’, width:75}, {name:’type’, index:’type’, width:50, align:’right’}, {name:’expiry’, index:’expiry’, width:60, align:’right’}, {name:’putCall’, index:’putCall’, width:65}, {name:’strike’, index:’strike’, sorttype: ‘float’, width:70}, {name:’account’, index:’account’, width:70}, {name:’long’, index:’long’, sorttype: ‘int’, width:55, align:’right’}, {name:’short’, index:’short’, sorttype: ‘int’, width:55, […]

格式化在Jqgrid中执行多行保存时选择框

我正在解决这里提到的问题 我能够以这样的方式对网格元素进行自定义格式,使得每行中可以编辑的列很少,我使用formatOptions将显示值设置为1并将新更改的值保存在隐藏字段中。 但是,当涉及到selectbox字段时,我读到了editoptions是通过formatoptions选择的。 所以目前我的选择框如下 editoptions: { dataUrl: ‘/lists/products’, buildSelect: function (data) { return “” + data + “”; } } 现在我需要将所选值存储到隐藏字段中这类 。 但有些我怎么也无法通过editoptions得到这个。 我试过的代码在这里。 editable:true, edittype:”select”, editoptions: { dataUrl: ‘/lists/products’, buildSelect: function (data) { return “” + data + “”; }, dataEvents: [ { type: ‘change’, fn: function(e) { console.log(e); html = ”; return html; […]

jqGrid使用json调用WebService(asmx)

我有一个jqGrid设置,使用application / json的内容类型发布到URL: $(“#jqCategoryGrid”).jqGrid({ datatype: “json”, mtype: ‘POST’, url: “Webservices/TroubleTicketCategory.asmx/getCategoryData”, ajaxGridOptions: { contentType: ‘application/json; charset=utf-8’ }, // **UPDATE – This is the fix, as per Oleg’s response** serializeGridData: function (postData) { if (postData.searchField === undefined) postData.searchField = null; if (postData.searchString === undefined) postData.searchString = null; if (postData.searchOper === undefined) postData.searchOper = null; //if (postData.filters === […]

使用Coldfusion cfc如何在编辑表单中格式化jqgrid相关选择的返回数据?

我试图弄清楚如何设置动态依赖选择。 这是我原始post的编辑,旨在使其更具可读性和清晰度。 我已经包含了我的整个网格,以防它有所帮助,但它可能是太多的信息。 网格显示完美。 $(document).ready(function() { $(“#list”).jqGrid( { url:’Users2.cfc?method=getUsers’, //CFC that will return the users datatype: ‘json’, //We specify that the datatype we will be using will be JSON cmTemplate:{resizable:false, width:124}, colNames:[‘Bill To Code’,’User ID’, ‘GL_comp_key’, ‘Branch ID’, ‘Warehouse ID’, ‘Final Approver’, ‘Active’, ‘Primary Approver’, ‘Administrative’,’Secondary Approver’], //Column Names //The Column Model colModel :[ {name:’ar_bill_key’,index:’ar_bill_key’,editable:true,searchoptions:{sopt: […]

JQGrid会自动隐藏单元格中带有false的行

我试图隐藏一行如果其中的单元格具有错误值,到目前为止我已尝试使用这样的格式化程序: $(“#list”).jqGrid({ //datatype: ‘clientSide’, colNames: [“Id”, “Descrizione”, “Data Vendita”, “Disabilitato”, “PISTA”, “Piano Tariffario”, “Data Validità Piano Tariffario”, “PROMO”, “Data Validità Promo”, “CANONE CLIENTE NETTO MESE”, “Vendibile”, “Migrato”], colModel: [ { name: “id”}, { name: “descrizione”, editable: true}, { name: “dataInizVendita”, editable: true, formatter:vendita}, { name: “disabilitato”, editable: true}, { name: “pista”, editable: true}, { name: […]

jqGrid – 字段的多重validation

我正在尝试validation多个日期字段,类似于它的完成方式 jqGrid – 字段validation 我跟着这个例子遇到了一个问题,用户可以选择多个字段,因为它们仍然可以编辑,但是在选择了另一个字段后没有回到显示模式。 任何援助将不胜感激。