Browse Source

Add onLoadSuccess and onLoadError events.

zhixin 11 years ago
parent
commit
f0641bcdcd
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/bootstrap-table.js

+ 7 - 1
src/bootstrap-table.js

@@ -101,7 +101,9 @@
         onCheck: function(row) {return false;},
         onUncheck: function(row) {return false;},
         onCheckAll: function() {return false;},
-        onUncheckAll: function() {return false;}
+        onUncheckAll: function() {return false;},
+        onLoadSuccess: function(data) {return false;},
+        onLoadError: function(status) {return false;}
     };
 
     BootstrapTable.prototype.init = function() {
@@ -637,6 +639,10 @@
             dataType: 'json',
             success: function(data) {
                 that.load(data);
+                that.onLoadSuccess(data);
+            },
+            error: function(res) {
+                that.onLoadError(res.status);
             },
             complete: function() {
                 that.$loading.hide();