jquery - datagrid column formatter not working -


i'm using jquery easyui datagrid present data user. i'm trying color data in columns of datagrid based on condition. did this:

$('#my_datagrid_id').datagrid({      columns:[[         {field:'qty', title:'quantity', formatter:function(val, row, idx){              if (val < 25){                 return '<span style="color:red;">('+val+')</span>';             } else {                 return val;             }                         }}     ]]  }); 

but reason, values of costs less 25 not colored red in datagrid. idea why code not working please?

thank you

for assumption, need specific grid column this

{field:'qty', title:'quantity',editor:{type:'numberbox'}, formatter:function(val, row, idx){ 

i have try combination , have no problem it

hope can you


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -