javascript - ng-click in slickgrid formatter doesn't work -


I'm a newbie in angular JS

I used to experiment with angular JSU-router and a slimgrid

  app.controller ('Customer Controller', [a] To Call a Web Service and Delete a Line  

'$ Scope' , '$ Compilation', 'customer service', work ($ amount, $ compilation, customer service) {// clients to get $ scope.getCustomers = tasks () {CustomerService.getCustomers ($ ("# userId") ") .val (), $ scope.getArchived). Then (function (the customer S) {dataView.beginUpdate (); DATAView. CATITIES (CUSTOMER); DATAView .Update (); grid.invalidate ();}, Function (Reason) to the customer $ scope.archiveCustomer = functionIt (customerId) {if (Confirm (Translate ("LBL_DELETE_CUSTOMER_CONFIRMATION"))) {CUSTO MerService.archiveCustomer (customerId) .then (function () {$ scope.getCustomers ();}, function (reason) {note ({text: reason, type: 'error '});});} Description is false; // create grid var dataview, grid; var option = {enableCellNavigation: true, enableColumnReorder: false, autoHeight: true}; Var column = [{id: "id", name: "", field: "id", width: 20, formatter: delete formarmer, css class: "centric column"}, {id: "customer", name: translate ("Customer"), field: "customer", width: 250}]; Function deleteFormatter (line, cell, value, column def, datacontext) {html = "& lt; img src = 'images / delete.gif' alt = '" + Translate ("LBL_leltcsec") + "' style = ' Cursor: pointer; 'ng-click =' archive customer ("+ datacontex. Edit +"); ' / & Gt; "; Linker = $ collection (angular element (html)); HtmlElements = linker ($ scope); Html = html elements [0] .outerHTML; HTML return; } DataView = New Slick.Data.DataView ({inlineFilters: true}); Grid = New Slick.Grid ("# customersGrid", DataView, Columns, Options); $ Scope.getCustomers (); }];

The img element is added by the Deleteformormer with my problem ng-click. what is wrong? I have seen the sample with the instructions but it is not clear in my mind ... can you stop me?

Edit

Try AsyncPostRender without success: Column Definition:

  var column = [ Id: "id", name: "", field: "id", width: 20, formater: asyncFormatter, asyncPostRender: deleteRender, cssClass: "centeredColumn"}, {Id: "Customer", Name: Translation ("Customer" ), Field: "customer", width: 250}];  

Formatter and render:

  function asyncFormatter (row, cell, value, column def, datacontext) {return "data loading ... "; } Function deleteRender (cellNode, row, dataContext, colDef) {html = "& lt; img src = 'images / delete.gif' alt = '" + translation ("LBL_DELETE_CUSTOMER") + "' style = 'cursor: pointer; ' Ng-click = 'archive customer ("+ datacontext.edit +");' / & Gt; "; Linker = $ collection (angular element (html)); HtmlElements = linker ($ scope); $ (Selnode) .empty () Cell node. HTMLHTML = HTMLElements [0] .outerHTML; }   

updated

" Formatter "The given column has only one configuration function, you will need to use a render function such as" asyncPostRender "for that column.

Your new element (removal IMG) is out of the area of ​​any angle. You need to compile this in the grid-line render event in the corner.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -