extjs - Compare date from combobox with current date -


i have combobox data store:

fields: [     {name: 'name',  type: 'string'},     {name: 'createdate',  type: 'string'} ] 

field 'createdate' has format "03.05.2015", combobox outputs field 'name':

{     xtype: 'combobox',     fieldlabel: 'nametext',     store: 'storeofnames',     querymode: 'local',     displayfield: 'name',     valuefield: 'id' } 

i want next:

combobox output: name + (if date in field createdate >= current date) add in combobox data 'createdate'.

you can trick: in model add item like:

{     name: 'display',     mapping: function(rec) {         return rec.name + (new date(rec.createdate) >= new date()             ? ' ' + rec.createdate             : '');     } } 

and in combobox change displayfield:

displayfield: 'display' 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -