The trouble caused by an extra comma

Source: Internet
Author: User

The problem is hidden above ie9, but on IE8, the error in easyui. Mini. JS is caused by an extra comma.

As follows:

Datatable_onsitedelegation.datagrid ({Title: 'onsite registration management', iconcls: 'icon-save', method: "Post", URL: '/samplereceive/loadonsitedelegationjson/', idfield: 'id', sortname: 'id', sortorder: 'asc ', pagesize: 20, striped: True, // display the zebra effect fit: True, pagination: True, // if it is true, the pagination toolbar is displayed at the bottom of the data table control. Rownumbers: True, fitcolumns: false, // the size of the column is automatically expanded/shrunk to fit the width of the grid and prevent horizontal scrolling. Singleselect: True, // if it is true, only one row can be selected. Columns: [[// {field: 'ck ', checkbox: true}, // {field: 'id', Title: 'id', width: 30, sortable: true, frozen: true}, // indicates the current status {field: 'teststatus', Title: 'type', width: 60, formatter: function (value) {Switch (value) {Case-1: Return "remote"; break; default: Return "onsite"; break ;}},{ field: 'sampleid', Title: 'sample number ', width: 80, sortable: True, frozen: true}, {field: 'serialnum', Title: 'factory number', Width: 100}, {field: 'name', Title: 'name', width: 80, sortable: True, frozen: true}, {field: 'type ', title: 'model', width: 100}, {field: 'mermername', Title: 'inspection unit ', width: 100}, {field: 'worktype', title: 'Job type', width: 100}, {field: 'submitdate', Title: 'submission date', width: 150, formatter: function (value) {var Re = /-? \ D +/; var M = re.exe C (value); If (M = NULL) {// alert ("the submission date field of the current record is blank! "); Return NULL;} var d = new date (parseint (M [0]); // return the date return in the format of [09:09:09. format ("yyyy-mm-dd hh: mm: SS") ;}}], onclickrow: function (rowindex, rowdata) {// alert ("th" + rowindex + "Row clicked"); updatebtnstatus (rowdata. teststatus) ;}, toolbar: [{text: "add", iconcls: 'icon-add', Handler: addonsitedelegation}, '-', {text: "edit ", iconcls: 'icon-edit', Handler: editonsitedelegation, ID: 'onsitedelegation _ editbtn '},'-', {text: "delete", iconcls: 'icon-delete ', handler: delonsitedelegation}, '-',]});

Note that a comma is added after "-" to make easyui think that there is a toolbar behind it, resulting in invalid BTN. Handler

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.