Builtin search panel disable whole grid with search panel. 2 more questions

一世执手 提交于 2019-12-25 04:18:02

问题


1 - Is it possible to change the layout of Add and Edit popups?

2 - How to disable navigation in the Edit popup?. Right and left buttons to navigate through records.

3 - I am testing JQGrid built in search. Problem is when ever I click on that small search icon popup disable whole grid with it search panel on top of it. Tried alot but no success. Note: All the other panels like Edit, Add etc are working fine

jQuery().ready(function () {

    jQuery("#list10").jqGrid({
        //url: 'server.php?q=2',
        data: mydata1,
        datatype: "local",
        colNames: ['Inv No', 'Date', 'Client', 'Amount', 'Tax', 'Total', 'Notes'],
        colModel: [
            { name: 'id', index: 'id', width: 55 },
            { name: 'invdate', index: 'invdate', width: 90 },
            { name: 'name', index: 'name asc, invdate', width: 100 },
            { name: 'amount', index: 'amount', width: 80, align: "right" },
            { name: 'tax', index: 'tax', width: 80, align: "right" },
            { name: 'total', index: 'total', width: 80, align: "right" },
            { name: 'note', index: 'note', width: 150, sortable: false }
        ],

        rowNum: 10,
        rowList: [10, 20, 30],
        pager: '#pager10',
        sortname: 'id',
        viewrecords: true,
        sortorder: "desc",
        caption: "JSON Example"
    });
    jQuery("#list10").jqGrid('navGrid', '#pager10', { edit: false, add: false, del: false }); 
});


                 var mydata1 = [
  { id: "1", invdate: "2010-05-24", name: "test", note: "note", tax: "10.00", total: "2111.00" },
  { id: "2", invdate: "2010-05-25", name: "test2", note: "note2", tax: "20.00", total: "320.00" },
  { id: "3", invdate: "2007-09-01", name: "test3", note: "note3", tax: "30.00", total: "430.00" },
  { id: "4", invdate: "2007-10-04", name: "test", note: "note", tax: "10.00", total: "210.00" },
  { id: "5", invdate: "2007-10-05", name: "test2", note: "note2", tax: "20.00", total: "320.00" },
  { id: "6", invdate: "2007-09-06", name: "test3", note: "note3", tax: "30.00", total: "430.00" },
  { id: "7", invdate: "2007-10-04", name: "test", note: "note", tax: "10.00", total: "210.00" },
  { id: "8", invdate: "2007-10-03", name: "test2", note: "note2", amount: "300.00", tax: "21.00", total: "320.00" },
  { id: "9", invdate: "2007-09-01", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: "430.00" },
  { id: "11", invdate: "2007-10-01", name: "test", note: "note", amount: "200.00", tax: "10.00", total: "210.00" },
  { id: "12", invdate: "2007-10-02", name: "test2", note: "note2", amount: "300.00", tax: "20.00", total: "320.00" },
  { id: "13", invdate: "2007-09-01", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: "430.00" },
  { id: "14", invdate: "2007-10-04", name: "test", note: "note", amount: "200.00", tax: "10.00", total: "210.00" },
  { id: "15", invdate: "2007-10-05", name: "test2", note: "note2", amount: "300.00", tax: "20.00", total: "320.00" },
  { id: "16", invdate: "2007-09-06", name: "test3", note: "note3", amount: "400.00", tax: "30.00"

回答1:


You asked many questions at once. So one after other.

  1. You don't described what you mean under "the layout of Add and Edit popups". All standard settings of the dialogs like position, width, height and so on you can find here. All other dynamic changes of layout you can do inside of beforeShowForm event handler which you could define.
  2. The easiest way to disable navidation buttons is to include .navButton { display:none; } in you CSS.
  3. Parameters of the search dialog you can find here. The setting overlay:false should help you.

So you can replace the line

jQuery("#list10").jqGrid('navGrid', '#pager10', {edit:false, add:false, del:false}); 

with something like following

jQuery("#list10").jqGrid('navGrid', '#pager10',
                         {edit:false, add:false, del:false},
                         {top:200,left:300,recreateForm:true}, // edit settings
                         {top:100,left:200,recreateForm:true}, // add settings
                         {overlay:false} // search settings
);


来源:https://stackoverflow.com/questions/4477476/builtin-search-panel-disable-whole-grid-with-search-panel-2-more-questions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!