Created
December 5, 2014 09:19
-
-
Save ziyahan/ac06f70edf53aca50a83 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _grid = $("#companies").data("kendoGrid"); | |
$("#companies").data("kendoGrid").dataSource.bind("change", function(e) { | |
// let's check whether the event is fired by a filter? | |
var filter = _grid.dataSource.filter(); | |
if(filter) { | |
console.log("there is a filter now"); | |
/* I know this because I have added a filter to the "id" column when the grid initialized. Nevertheless, we should control whether filter is our predefined filter or not.*/ | |
if(filter.filters[0].field=="id") { | |
var row = _grid.dataItems()[0]; | |
$("#authorized").val(row.authorized); | |
$("#telephone").val(row.telephone); | |
$("#mobile").val(row.mobile); | |
$("#email").val(row.email); | |
} else { | |
//yes, there is a filter but it doesn't not belong to us, so we should do anything | |
//TODO | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment