在编辑表单中编辑jqgrid中的行时,无法显示超过8行

时间:2015-01-14 01:52:34

标签: c# asp.net jqgrid

我已经关注了JQGrid文章和这里提供的帮助,并且能够在JQGrid中显示一个表。我能够使用编辑表单模式进行CRUD操作。我试图为另一个表重复相同的方法,但是比第一个表有更多的字段。在第二种情况下,编辑表单中仅显示8行。 jqgrid colmodel使用rowpos和colpos直到第10行。

我看了JQGrid - show additional columns in edit form但是当我检查这个例子时,它显示了我按照例子的8行。使用dataheight,我能够增加表单的高度,但仍然没有显示其他行。

有人可以帮忙吗?提前谢谢。

Colmodel如下 -

    colModel: [
        { name: 'Id', index: 'Id', formatter: 'int', hidden: true /*, width: 100, align: 'right', frozen: true, editoptions: { defaultValue: 0 }*/
        }
        , { name: 'Name', index: 'Name', width: 300, template: stringEdColTemplate
                , editoptions: { maxlength: 50, size: 40 }
                , formoptions: { elmsuffix: ' *', rowpos: 1, colpos: 1 }, editrules: { required: true/*, custom:true, custom_func:formcheck*/ }
        }
        , { name: 'Code', index: 'Code', formatter: 'string', align: 'left', editable: true
            , editoptions: { maxlength: 20, size: 40 }
            , formoptions: { elmsuffix: ' *', rowpos: 2, colpos: 1 }, editrules: { required: true, custom: true, custom_func: depotCodeLength }
        }
        , { name: 'Email', index: 'Email', width: 150, formatter: 'string', align: 'left', editable: true
        , editoptions: { size: 40, email:true}, formoptions: { elmsuffix: ' *', rowpos: 3, colpos: 1 }, edittype: 'text'
            , editrules: { required:true }
        }
        , { name: 'Location', index: 'Location', formatter: 'string', align: 'left', editable: true
            , editoptions: { maxlength: 9, size: 40 }
            , formoptions: { elmsuffix: ' *', rowpos: 5, colpos: 1 }, editrules: { required: true }
        }
        , { name: 'IsActive', index: 'IsActive', width: 75, formatter: 'checkbox', align: 'center', edittype: 'checkbox'
        , formoptions: { rowpos: 8, colpos: 1 }, editable: true, editoptions: { value: 'Yes:No', defaultValue: 'Yes' }
        }
        , { name: 'Password', index: 'Password', width: 150, formatter: 'string', align: 'left', editable: true, hidden: true
        , editoptions: { size: 40 }
            , formoptions: { elmsuffix: ' *', rowpos: 4, colpos: 1 }, edittype: 'text'
            , editrules: { required: true, edithidden:true }
        }
        , { name: 'Address1', index: 'Address1', width: 150, formatter: 'string', align: 'left', edittype: 'text'
                , editoptions: { maxlength: 25, size: 40 }, hidden:true
                , formoptions: { rowpos: 6, colpos: 1 }, editable: true, editrules: { edithidden:true }
        }
        , { name: 'Address2', index: 'Address2', width: 150, formatter: 'string', align: 'left', edittype: 'text'
                , editoptions: { maxlength: 25, size: 40 }, hidden:true
                , formoptions: { rowpos: 7, colpos: 1 }, editable: true, editrules: { edithidden:true }
        }
        , { name: 'State', index: 'State', width: 150, formatter: 'string', align: 'left', edittype: 'text'
                , editoptions: { maxlength: 25, size: 40 }, hidden:true
                , formoptions: { rowpos: 1, colpos: 2 }, editable: true, editrules: { edithidden:true }
        }
        , { name: 'Country', index: 'Country', width: 200, formatter: 'string', align: 'left', formoptions: { elmsuffix: ' *', rowpos: 2, colpos: 2 }
            , hidden:true, editable: true
                , edittype: 'select', editrules: { required: true }
                , editoptions: countryOptions
        }
        , { name: 'CountryCode', index: 'CountryCode', width: 50, formatter: 'string', align: 'left', hidden: true }
        , { name: 'Zip', index: 'Zip', width: 50, formatter: 'string', align: 'left', edittype: 'text'
            , editoptions: { maxlength: 25, size: 40 }, formoptions: { rowpos: 3, colpos: 2 }, editable: true
            , editrules: { edithidden: true }, hidden: true
        }
        , { name: 'HomePhone', index: 'HomePhone', width: 50, formatter: 'string', align: 'left', edittype: 'text'
            , editoptions: { maxlength: 25, size: 40 }, formoptions: { rowpos: 4, colpos: 2 }, editable: true
            , editrules: { edithidden: true }, hidden: true
        }
        , { name: 'WorkPhone', index: 'WorkPhone', width: 50, formatter: 'string', align: 'left', edittype: 'text'
            , editoptions: { maxlength: 25, size: 40 }, formoptions: { rowpos: 5, colpos: 2 }, editable: true
            , editrules: { edithidden: true }, hidden: true
        }
        , { name: 'Mobile', index: 'Mobile', width: 50, formatter: 'string', align: 'left', edittype: 'text'
            , editoptions: { maxlength: 25, size: 40 }, formoptions: { rowpos: 6, colpos: 2 }, editable: true
            , editrules: { edithidden: true }, hidden: true
        }
        , { name: 'Path', index: 'Path', align: 'right', formatter: 'string', editable: true, hidden: true }
        , { name: 'Day1', index: 'Day1', width: 75, , formatter: 'checkbox', align: 'center', edittype: 'checkbox', hidden:true
        , formoptions: { rowpos: 8, colpos: 2 }, editable: true, editoptions: { edithidden:true, value: 'Yes:No', defaultValue: 'Yes' }
        }
         , { name: 'Day2', index: 'Day2', width: 75, , formatter: 'checkbox', align: 'center', edittype: 'checkbox', hidden: true
        , formoptions: { rowpos: 9, colpos: 1 }, editable: true, editoptions: { edithidden:true, value: 'Yes:No', defaultValue: 'Yes' }
        }
          , { name: 'Day3', index: 'Day3', width: 75, , formatter: 'checkbox', align: 'center', edittype: 'checkbox', hidden: true
        , formoptions: { rowpos: 9, colpos: 2 }, editable: true, editoptions: { edithidden:true, value: 'Yes:No', defaultValue: 'Yes' }
        }
        , { name: 'Day4', index: 'Day4', width: 75, , formatter: 'checkbox', align: 'center', edittype: 'checkbox', hidden: true
        , formoptions: { rowpos: 10, colpos: 1 }, editable: true, editoptions: { edithidden:true, value: 'Yes:No', defaultValue: 'Yes' }
        }
         , { name: 'Day5', index: 'Day5', width: 75, , formatter: 'checkbox', align: 'center', edittype: 'checkbox', hidden: true
        , formoptions: { rowpos: 10, colpos: 2 }, editable: true, editoptions: { edithidden:true, value: 'Yes:No', defaultValue: 'Yes' }
        }
         , { name: 'Day6', index: 'Day6', width: 75, , formatter: 'checkbox', align: 'center', edittype: 'checkbox', hidden: true
        , formoptions: { rowpos: 11, colpos: 1 }, editable: true, editoptions: { edithidden:true, value: 'Yes:No', defaultValue: 'Yes' }
        }
         , { name: 'Day7', index: 'Day7', width: 75, , formatter: 'checkbox', align: 'center', edittype: 'checkbox', hidden: true
        , formoptions: { rowpos: 11, colpos: 2 }, editable: true, editoptions: { edithidden:true, value: 'Yes:No', defaultValue: 'Yes' }
        }
      ]

jQgrid show hidden column in form view

中找到答案

1 个答案:

答案 0 :(得分:0)

我建议你先不用rowpos和colpos进行测试。如果显示正确的列数,您可能需要再次查看代码以查找错误。

亲切的问候