jqgrid number formatter use -


in formatter, i've got following code:

formatter: {     number: { decimalseparator: ".", thousandsseparator: " ", decimalplaces: 4, defaultvalue: '0.0000' } }, 

and in colmodel have:

  { name: 'salesprice', index: 'salesprice', width: 90, align: 'left', formatter:'number', editable: true, editoptions:                   {                       readonly: true                   }                   } 

my datatype set "local"

when first display form, "0.00" , not "0.0000" hoping for. morever, in inline editing mode, salesprice value changes depending upon other cells in grid. after updates salesprice value shown integer.

what doing wrong?

edit: more complete code

$("#customerorderlinelist").jqgrid({     //      url: 'someurl',     datatype: 'local',     formatter: {         number: { decimalseparator: ".", thousandsseparator: " ", decimalplaces: 4, defaultvalue: '0.0000' }     },     //      mtype: 'post',     colnames: [ 'part number', 'sales price'],     colmodel: [                   { name: 'partnumber', index: 'partnum', width: 90, align: 'left', editable: true, editoptions:                   {                       datainit: function (el) {                           $(el).autocomplete({                               source: "autocomplete",                               minlength: 1                           });                       }                   }                   },                    { name: 'salesprice', index: 'salesprice', width: 90, align: 'left', formatter: 'number',                       formatoptions: { decimalseparator: ".", thousandsseparator: " ", decimalplaces: 4, defaultvalue: '0.0000' }, editable: true, editoptions:                   {                       readonly: true                   }                   }              ],     pager: jquery('#pager'),     rownum: 10,     rowlist: [5, 10, 20, 50],     sortable: true,     sortname: 'partnum',     sortorder: "asc",     viewrecords: true,     imgpath: '',     autowidth: true,     onselectrow: function (id, status) {         if (id && id !== lastsel) {             $('#customerorderlinelist').jqgrid('restorerow', lastsel);             $('#customerorderlinelist').jqgrid('editrow', id, true);             lastsel = id;         }     },     caption: 'caption' }); 

you don't posted full code it's difficult problem. @ the demo explain , has no problem.

i used formatoptions because unclear me set formatter values th number.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -