Browse Source

Updated noeditFormatter to noEditFormatter

zhixin 5 years ago
parent
commit
1602d8b5c2

+ 3 - 3
site/docs/extensions/editable.md

@@ -73,13 +73,13 @@ Use Plugin: [x-editable](https://github.com/vitalets/x-editable)
   </table>
   {% endhighlight %}
 
-  You can use `noeditFormatter` to disable the editable column, for example:
+  You can use `noEditFormatter` to disable the editable column, for example:
 
   {% highlight javascript %}
   {
     editable: {
-      noeditFormatter (value, row, index) {
-        if (value === 'noedit') {
+      noEditFormatter (value, row, index) {
+        if (value === 'noEdit') {
           return 'No Edit'
         }
         return false

+ 5 - 5
src/extensions/editable/bootstrap-table-editable.js

@@ -77,22 +77,22 @@ $.BootstrapTable = class extends $.BootstrapTable {
           editableDataMarkup.push(` ${key}="${value}"`)
         })
 
-        let _dont_edit_formatter = false
+        let noEditFormatter = false
         const editableOpts = Utils.calculateObjectValue(column,
           column.editable, [index, row], {})
 
-        if (editableOpts.hasOwnProperty('noeditFormatter')) {
-          _dont_edit_formatter = editableOpts.noeditFormatter(value, row, index)
+        if (editableOpts.hasOwnProperty('noEditFormatter')) {
+          noEditFormatter = editableOpts.noEditFormatter(value, row, index)
         }
 
-        if (_dont_edit_formatter === false) {
+        if (noEditFormatter === false) {
           return `<a href="javascript:void(0)"
             data-name="${column.field}"
             data-pk="${row[this.options.idField]}"
             data-value="${result}"
             ${editableDataMarkup.join('')}></a>`
         }
-        return _dont_edit_formatter
+        return noEditFormatter
       }
     })
   }