Restangular, AngularJS and Kendo UI Grid -


My problem is that I use the Kendo-grid as follows

index.html

  & lt; Table kendo-grid k-options = "grid options" k-ng- delay = "grid option" id = "grid" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th data-field = "type" & gt; Type & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; & Lt; Tr ng-repeat = "assets in assets" & gt; & Lt; TD & gt; {{Asset.type}} & lt; / TD & gt; & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt;  

and use a factory for transnational

  angular. Module ('myApp'). Confirm (functional configurator) {Residential Configureer} with Factor ('assetFactory', function (rest) .Setbus URL ('my / service / url');})}}  

Then property in Ctrl

  assetFactory.all ('cases'). GetList (). Then (task (property) {$ scope.assets = property;}); ...... ... $ timeout (function () {$ scope.gridOptions = {sortable: true, selectable: true, scrollable: true, groupable: true, height: 790, pageable: {page size: 25, Input: True}};}, 500);  

Now this work But I'm not adding or updating more features for columns because everything has been generated in index.html, so I think I have no control over it.

I want to make it something like this

index.html just

  kendo-grid k-ng-delay in k-options = "grid options" = "GridOptions" & gt; & lt; / cando grid & gt;  

and holding it as a factory (by special one)

then press Ctrl

  var MyData = new kendo.data datasource {Data: ** // Assign assets} ** $ timeout (function () {$ scope.gridOptions = {data source: myData, column: [** filtering for each field Fields with attributes ** true, selectable: True, Scrollable: Correct, Congable: Correct, Height: 790, Page Qualified: {Page Size: 25, Input: true}};}, 500);  

Anyone else can tell me how my service can look back ?? Jason Array or ....?

Any help?

Thank you in advance

I know that this question is a few months old, But I had to figure out how to relax and play the Candido UI grid today. I finally came in the context of the Kendodeta Datasource API:

Note: There are some solutions in it, which advise using data source pius or datasource. And basically use it for a for-loop Jason is moving the array. This is a bad idea. Press both after triggering a trigger.

Still, solution using Datasource.Resport. Read:

Angular HTML Template:

  & lt; Kendo-Grid k-option = "Main grid option" & gt; & Lt; / Kendo-grid & gt;  

Appropriate controller code:

  // Set grid columns. The 'title' is labeled, 'field' is the same json field name. {Title: "asset type", field: "asset"}, {title: "asset case name", field: "name"}, {title: "asset case ID", field: "id"} ,]; // Create a new cando datasource and set up the transport. Read a function. Var kDataSource = new kendo.data.DataSource ({pageSize: 10, transport: {read: function (e) {var assetListPromise = assetFactory.all ('cases'). GetList (); assetListPromise.then (function) // Use Plain () to extract all additional relaxation features from the response. Plain = resp.plain (); // your data back to the data source / grid e.success (plain);}); assetListPromise. (Resp) {var msg = "Property Load Issues:" + JSON.stringify (resp); e.error (msg)});}}}); // Set scope objects with our columns and data source configurations $ scope.mainGridOptions = {Data Source: kDataSource, sortable: true, pageable: true, column: kGridColumns};  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -