内置搜索面板使用搜索面板禁用整个网格。还有2个问题

时间:2010-12-18 09:25:44

标签: jqgrid

1 - 是否可以更改“添加”和“编辑”弹出窗口的布局?

2 - 如何在“编辑”弹出窗口中禁用导航?用于浏览记录的左右按钮。

3 - 我正在测试内置搜索的JQGrid。问题是我什么时候点击那个小搜索图标 弹出窗口禁用整个网格与它上面的搜索面板。尝试了很多但没有成功。 注意:编辑,添加等所有其他面板工作正常

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 个答案:

答案 0 :(得分:0)

你立刻问了很多问题。所以一个接一个。

  1. 您没有在“添加和编辑弹出窗口的布局”中描述您的意思。您可以找到here对话框的所有标准设置,如位置,宽度,高度等。您可以在beforeShowForm事件处理程序内部进行所有其他动态布局更改。
  2. 禁用导航按钮的最简单方法是在CSS中包含.navButton { display:none; }
  3. 您可以找到here的搜索对话框的参数。设置overlay:false可以为您提供帮助。
  4. 所以你可以替换

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

    有类似下面的内容

    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
    );