如何在jqgrid中维护基本数据和完整数据?

时间:2015-10-14 21:21:26

标签: jquery jqgrid jqgrid-formatter jqgrid-php

我有一个维护数据库文件的jqgrid。

显示的编辑/添加表单是基本信息,其余表单设置为默认值。

我想要做的是让用户点击表单中的按钮,然后让他们访问完整的信息。

实现这一目标的最佳方法是什么?

谢谢。

注意:还有更多列。为了示例目的,我缩短了列表。

以下是代码的一部分:

$(function () {    

jQuery("#PClist").jqGrid({
url: "pyg280cload.php",
editurl: "pyg280cedit.php",
datatype: "json",
mtype: "POST",
colNames:["Row ID", "State", "Seq #", "Active", "Select Stores", "Pay Type","Hours Required", "Hourly Increment", "Include Tips"],
colModel:[{name: "PCROWID", width: 60, align: "center", editable:true, hidden:true, editoptions: {readonly:true}},
{name: "PCST", width: 60, align: "center", editable:true, editoptions: {readonly:true}, editrules: {required:true, number:false}},
{name: "PCLSEQ", width: 60, align: "center", editable:true, editoptions: {readonly:true}, editrules: {required:true, number:true}, formatter:'number', formatoptions:{decimalPlaces: 0, defaultValue: '0'}},
{name: "PCACTIVE", width: 60, align: "center", editable:true, editrules: {edithidden:true}, edittype:"checkbox", editoptions: {value:"Y:N"}},
{name: "SelectStores", width: 80, align: "center", editable:true, hidden:true, editrules: {edithidden:true}, edittype:"button", editoptions: {value:"Select Stores"}},
{name: "PCPAY", width: 60, align: "center", editable:true, edittype:"select", editoptions:{value:{H:'Hourly', S:'Salary', B:'Both'}}},
{name: "PCHRSREQ", width: 60, align: "center", editable:true, hidden:true, editrules: {number:true, edithidden:true}},
{name: "PCHRSINCR", width: 60, align: "center", editable:true, hidden:true, edittype:"checkbox", editoptions: {value:"Y:N"}},
{name: "PCTIPS", width: 60, align: "center", editable:true, hidden:true, editrules: {edithidden:true}, edittype:"checkbox", editoptions: {value:"Y:N"}},

...

0 个答案:

没有答案