angularjs - Ng-grid search bar in the grid -
Currently I'm using NG-Grid and Grid options, It puts a triangle drop down in the upper right corner of the grid, which when a click is popped, a search bar pops up. What's the way with the ng-grid, from which the search bar appears directly in the grid without the need to click on the triangle? Sure, wherever you want to input the input, with your NG-grid in your view: < / P> and then in your controller: showFilter: true
& lt; Input type = "text" data-ng-model = "out_search_text" placeholder = "search" category = "form-control" data-ng-change = "search ()" & gt; & Lt; Div class = "grid style" data-ng-grid = "grid option" & gt; & Lt; / Div & gt;
$ scope.sortOptions = {field: ['id'], instructions: ['dess']}; $ Scope.totalServerItems = 0; $ Scope.gridOptions ['sortInfo'] = $ scope.sortOptions; $ Scope.gridOptions ['columnDefs'] = [[Field: 'name', displayName: 'name'}]; $ Scope.refresh = function () {var p = {searchText: {name: $ scope.outside_search_text}, page number: $ scope.paging option. Crant Page, Page Size: $ scope.pagingOptions.pageSize, sortField: $ scope.sortOptions.fields, Sort direction: $ scope.sortOptions.directions}; Your Services Gateway (P) Then (function (feedback) {var content = getResponseData (response); $ scope.totalServerItems = content.count; $ scope.myData = content.result_set; if (content ['result_set'] length & gt; 0) {// Whatever else} {// whatever}}); };
Comments
Post a Comment