How to Specify format for Datatable column in HTML

Following HTML won’t work , If you please point me to right documentation, then that willl be great!

<div style="width:750px;">
  <div webix-ui view="datatable" id="table" webix-data="records" autoheight="true" select="row">
    <div view="column" id="rating" sort="int" css="rating">Rating</div>
    <div view="column" id="year"   sort="int">Year</div>
    <div view="column" id="votes"  sort="int"   format="webix.Number.numToStr({
            groupDelimiter:',',
            groupSize:3,
            decimalDelimiter:'.',
            decimalSize:2}">Votes</div>
    <div view="column" id="title"  sort="string" fillspace="1">Title</div>  
  </div>
</div>

How do you post HTML code here?

When using this code with in angular controller - it does work
http://webix.com/snippet/76a25f57

As for code formatting - editor supports markdown, so you can use 4 spaces before code lines or ~~~ markers at start and end of code ( same as on github or stackoverflow )

Thanks,
It’s not working I can send you a sample which shows the problem,
How do i attach a file ( zip)

Apologies!
I should be more clear here, The problem is application runs fine but i don’t get “votes” formatted as “723223.00” I need 2 decimal places.

Thanks

Sorry, I have missed this part of the code.

Please check http://webix.com/snippet/8d65a555

You can’t include active code in attributes, but you can define your own format as part of locale and use the name of format in the config.

Thanks you for the prompt response, It works now
Regards
Toshendra

I prepared a demo to show my issue
http://webix.com/snippet/eb7ffc41

Thanks
Toshendra

Check the updated snippet

  • a) function is assigned to the scope
  • b) value will be a formatted string, so you need to use obj[column] instead