GithubHelp home page GithubHelp logo

Grid cell template about angular-kendo HOT 8 CLOSED

kendo-labs avatar kendo-labs commented on July 24, 2024
Grid cell template

from angular-kendo.

Comments (8)

thomasfritz avatar thomasfritz commented on July 24, 2024

Hello Glenn,

can you post a sample for using kendo templates for a cell of a grid? I had difficulties with that approach.

Thanks!

Kind Regards

Thomas

from angular-kendo.

 avatar commented on July 24, 2024

It's not very difficult. I do it the easy way: I pass an html snippet to the column config:

columns = [
{field:"myobject", template: "<a href='#= myobject.link#'>#=myobject.label#</a>"}
]

The problem I have now is that sorting and filtering won't work anymore and it seems that Telerik doesn't support this...

from angular-kendo.

thomasfritz avatar thomasfritz commented on July 24, 2024

Hi Glenn, thank you for your fast answer. I will try your solution! Further I will hope you find a solution for your problem with the sorting and filtering!

from angular-kendo.

burkeholland avatar burkeholland commented on July 24, 2024

@glenndejaeger I'm going to propose this as part of the 0.6 release, but Kendo UI templates don't work the same way that Angular does. Kendo UI actually evals the template and creates a new function. This allows you to embed JavaScript in your templates.

from angular-kendo.

 avatar commented on July 24, 2024

I have a problem when using a directive in a cell template. My directive is called this way in the template:

<div bp-link="#= description.link #" label="#= description.label #"></div>

The content of the bp-link directive is:

<a class="bp-link" title={{label}}>{{label}}</span> <i class="icon-share" ng-click="followLink(true)"></i></a>

Now, when I view the grid, this is the HTML that's generated in the cell:

<a class="bp-link ng-binding" title="MYTITLE" bp-link="MYLINK" label="MYTITLE">MYTITLE<i class="icon-share" ng-click="followLink(true)"></i></a>

After sorting on that column, the directive isn't replaced and this this is the content of a cell in this column:

<div bp-link="`MYLINK" label="MYTITLE" class="ng-isolate-scope ng-scope"></div>
``

How can I tell Kendo Grid that after sorting (or client side paging too), the directive needs to be re-evaluated?

from angular-kendo.

burkeholland avatar burkeholland commented on July 24, 2024

@glenndejaeger We can recompile the rows when the dataSource "change" event fires. Can you replicate the issue in a Plunk and then I'll see about adding the compilation step in and check the fallout.

from angular-kendo.

artemyarulin avatar artemyarulin commented on July 24, 2024

Any progress on this issue? It's quite critical I suppose. In short we cannot use angular for cells

from angular-kendo.

mishoo avatar mishoo commented on July 24, 2024

Here's a plunker showing Angular templates in columns: http://plnkr.co/edit/R1tXm2TOJ3FnASUoYo3e?p=preview

When you click the "show" you'll get details in a dialog, and you can even edit. The third column (Location) displays {{dataItem.City}}, {{dataItem.Country}} and gets updated properly as you edit the city/country in that dialog.

Sorting is not supported currently for template columns.

If there are any other issues you guys see here, please post a plunker that demonstrates them.

from angular-kendo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.