Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/444.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 屏蔽UI XML内联编辑_Javascript_Jquery_Gridview_Grid_Shieldui - Fatal编程技术网

Javascript 屏蔽UI XML内联编辑

Javascript 屏蔽UI XML内联编辑,javascript,jquery,gridview,grid,shieldui,Javascript,Jquery,Gridview,Grid,Shieldui,我不了解很多屏蔽用户界面。文件对我来说很模糊。我想做的是让用下面的代码生成的表变成可编辑的。我试过了所有的方法,觉得我很接近,但没有用。有人能给我引路吗?此外,我还查看了他们的文档 <script type="text/javascript"> $(function() { $(document).ready(function()) { $("#grid").shieldGrid({ dataSource: { remote

我不了解很多屏蔽用户界面。文件对我来说很模糊。我想做的是让用下面的代码生成的表变成可编辑的。我试过了所有的方法,觉得我很接近,但没有用。有人能给我引路吗?此外,我还查看了他们的文档

<script type="text/javascript">
  $(function() {
    $(document).ready(function()) {
      $("#grid").shieldGrid({
        dataSource: {
          remote: {
            read: g,
            modify: {
              url: "xml/smt-schedule.xml"
            },


          },
          /*End remote */

          schema: {
            type: "xml",
            data: "ss_schedule",
            fields: {
              Id: {
                path: "ss_id._text"
              },
              Part_Num: {
                path: "ss_part_num._text"
              },
              ROHS: {
                path: "ss_rohs._text"
              },
              Wave_SS: {
                path: "ss_wave_ss._text"
              },
              WO: {
                path: "ss_wo._text"
              },
              Quantity: {
                path: "ss_qty._text"
              },
              Duration: {
                path: "ss_duration._text"
              },
              Start_Date: {
                path: "ss_wo_start._text"
              },
              Total_Time: {
                path: "ss_total_time._text"
              },
              Days: {
                path: "ss_est_days._text"
              },
              Run_Date: {
                path: "ss_est_run_date._text"
              },
              Pulled: {
                path: "ss_pulled._text"
              },
              Prep: {
                path: "ss_prep._text"
              },
              SMT: {
                path: "ss_smt._text"
              },
              Notes: {
                path: "ss_notes._text"
              }
            },

          },
          /* Line 48 Schema */

        },

        /*Begin Code for paging */
        paging: {
          pageSize: 30,
          pageLinksCount: 10,
          messages: {
            infoBarTemplate: "From {0} to {1} items of a total of {2}",
            firstTooltip: "First page",
            previousTooltip: "Previous page",
            nextTooltip: "Next page",
            lastTooltip: "Last page"
          }
        },
        /*End of paging start line 75*/

        /*End Code for paging */

        rowHover: false,
        columns: [{
            field: "Id",
            width: "20px",
            editable: false
          }, {
            field: "Part_Num",
            width: "100px",
            editable: true
          }, {
            field: "ROHS",
            width: "80px",
            editable: true
          }, {
            field: "Wave_SS",
            title: "Wave/SS",
            width: "80px"
          }, {
            field: "WO",
            width: "60px",
            editable: true
          }, {
            field: "Quantity",
            width: "80px",
            editable: true
          }, {
            field: "Duration",
            width: "80px",
            editable: true
          }, {
            field: "Start_Date",
            title: "Start Date",
            width: "80px",
            type: Date,
            editable: true
          }, {
            field: "Total_Time",
            title: "Total Time",
            width: "80px",
            editable: true
          }, {
            field: "Run_Date",
            title: "Run Date",
            width: "80px",
            type: Date,
            editable: true
          }, {
            field: "Pulled",
            width: "50px",
            editable: true
          }, {
            field: "Prep",
            width: "50px",
            editable: true
          }, {
            field: "SMT",
            width: "50px",
            editable: true
          }, {
            field: "Notes",
            width: "80px",
            editable: true
          }, {
            width: 80,
            title: " ",
            buttons: [{
              commandName: "edit",
              caption: "Edit"
            }, {
              commandName: "delete",
              caption: "Delete"
            }]
          }

        ],
        editing: {
          enabled: true,
          Event: "doubleclick",
          type: "row",
          mode: "inline",


          confirmation: {
            "delete": {
              enabled: true,
              template: function(item) {
                return "Delete work order '" + item.WO + "'?";
              }
            }
          }
        },

        /*--End toolbar--*/


        toolbar: [{
          buttons: [{
            commandName: "pdf",
            caption: '<span class="sui-sprite sui-grid-icon-export-pdf"></span> <span class="sui-grid-button-text">Export to PDF</span>'
          }]
        }],
        exportOptions: {
          proxy: "/filesaver/save",
          pdf: {
            fileName: "smt-schedule-report.pdf",
            author: "Dynalab, Inc.",
            size: "a4",
            orientation: "landscape",
            fontSize: 10,
            margins: {
              left: 40
            }

          } /*End pdf */


        },
        /*End expportOptions */
        toolbar: [{
          buttons: [{
            commandName: "insert",
            caption: "Add Record"
          }],
          position: "top"
        }]

      });
      /* Begin search by typing */
      var dataSource = $("#grid").swidget().dataSource,
        input = $("#filterbox input"),
        timeout,
        value;
      input.on("keydown", function() {
        clearTimeout(timeout);
        timeout = setTimeout(function() {
          value = input.val();
          if (value) {
            dataSource.filter = {
              or: [{
                  path: "Part_Num",
                  filter: "contains",
                  value: value
                }, {
                  path: "WO",
                  filter: "contains",
                  value: value
                }

              ]
            };
          } else {
            dataSource.filter = null;
          }
          dataSource.read();
        }, 300);

        /*End search by typing */
      });
    }
  }); /*End document.ready */
</script>

$(函数(){
$(文档).ready(函数()){
$(“#网格”).shieldGrid({
数据源:{
远程:{
改为:g,
修改:{
url:“xml/smt schedule.xml”
},
},
/*末端遥控器*/
模式:{
键入:“xml”,
数据:“ss_计划”,
字段:{
身份证:{
路径:“ss_id.\u文本”
},
第九部分:{
路径:“ss\u part\u num.\u text”
},
ROHS:{
路径:“ss_rohs._文本”
},
波浪:{
路径:“ss_wave_ss.\u text”
},
WO:{
路径:“ss_wo.\u text”
},
数量:{
路径:“物料数量\文本”
},
持续时间:{
路径:“持续时间.\u文本”
},
开始日期:{
路径:“ss_wo_start.\u text”
},
总时间:{
路径:“总时间。\u文本”
},
天数:{
路径:“最短天数.\u文本”
},
运行日期:{
路径:“ss_est_run_date._text”
},
拉:{
路径:“ss_拉._文本”
},
准备:{
路径:“ss_prep._text”
},
SMT:{
路径:“ss\U smt.\U文本”
},
注:{
路径:“ss_注释._文本”
}
},
},
/*第48行模式*/
},
/*开始分页的代码*/
寻呼:{
页面大小:30,
PageLinkScont:10,
信息:{
infoBarTemplate:“从{0}项到{1}项,共{2}”,
第一个工具提示:“第一页”,
上一个工具提示:“上一页”,
下一页:“下一页”,
最后工具提示:“最后一页”
}
},
/*寻呼起始行75结束*/
/*分页的结束代码*/
rowHover:false,
栏目:[{
字段:“Id”,
宽度:“20px”,
可编辑:false
}, {
字段:“Part_Num”,
宽度:“100px”,
可编辑:真
}, {
字段:“ROHS”,
宽度:“80px”,
可编辑:真
}, {
字段:“波浪”,
标题:“波浪/SS”,
宽度:“80px”
}, {
字段:“WO”,
宽度:“60px”,
可编辑:真
}, {
字段:“数量”,
宽度:“80px”,
可编辑:真
}, {
字段:“持续时间”,
宽度:“80px”,
可编辑:真
}, {
字段:“开始日期”,
标题:“开始日期”,
宽度:“80px”,
类型:日期,
可编辑:真
}, {
字段:“总时间”,
标题:“总时间”,
宽度:“80px”,
可编辑:真
}, {
字段:“运行日期”,
标题:“运行日期”,
宽度:“80px”,
类型:日期,
可编辑:真
}, {
字段:“拉”,
宽度:“50px”,
可编辑:真
}, {
字段:“准备”,
宽度:“50px”,
可编辑:真
}, {
字段:“SMT”,
宽度:“50px”,
可编辑:真
}, {
字段:“注释”,
宽度:“80px”,
可编辑:真
}, {
宽度:80,
标题:“,
按钮:[{
命令名:“编辑”,
标题:“编辑”
}, {
命令名:“删除”,
标题:“删除”
}]
}
],
编辑:{
启用:对,
事件:“双击”,
键入:“行”,
模式:“内联”,
确认:{
“删除”:{
启用:对,
模板:功能(项目){
返回“删除工单”'+item.WO+“?”;
}
}
}
},
/*--结束工具栏--*/
工具栏:[{
按钮:[{
命令名:“pdf”,
标题:“导出为PDF”
}]
}],
出口选择:{
代理:“/filesaver/save”,
pdf:{
文件名:“smt进度报告.pdf”,
作者:“Dynalab,Inc.”,
尺寸:“a4”,
定位:“景观”,
尺寸:10,
利润:{
左:40
}
}/*完pdf*/
},
/*结束导出选项*/
工具栏:[{
按钮:[{
命令名:“插入”,
标题:“添加记录”
}],
位置:“顶部”
}]
});
/*通过键入开始搜索*/
var dataSource=$(“#网格”).swidget().dataSource,
输入=$(“#过滤器盒输入”),
超时,
价值
input.on(“keydown”,function()){
clearTimeout(超时);
timeout=setTimeout(函数(){
value=input.val();
如果(值){
dataSource.filter={
或:[{
路径:“Part_Num”,
过滤器:“包含”,
价值:价值
}, {
路径:“WO”,
过滤器:“包含”,
价值:价值