I'm using the extension from (Saki - see Extjs.eu) metaform in order to generate a window with a variable number of fields on it.
Everything is working as expected...
except that when adding a 'textarea' field, and that fields contains a CRLF that user has entered, I get an error because of invalid Json... (see prtsrn)
i think the problem cas be easily solved by replacing the special chars by their html countervalue (i.e crlf should become \n)
The link to the metaform code http://www.sencha.com/forum/showthre...ed-from-server
As always, i think i'm close to the solution, but elas in this case... this is beyond my current javascript/extjs knowledge..
i know it needs to be solved by replacing the 'special' values by their json-friendly-counterpart (i.e CRLF by \n) but my problem is: where should i put the code in !!!
i hope someone could help me on that !
Everything is working as expected...
except that when adding a 'textarea' field, and that fields contains a CRLF that user has entered, I get an error because of invalid Json... (see prtsrn)
i think the problem cas be easily solved by replacing the special chars by their html countervalue (i.e crlf should become \n)
Code:
var getRecTemp = function(Lmode) { mode = Lmode; Ext.Ajax.request({ url: 'vvcall.pgm', params: { pgm: 'TDTK10R', action: 'getForm1', machine: currentRecord.data.MINEQUIP, template: DataStoreDetail.getAt(globalRowIndex).get('XDXTEXT') }, success: function(response) { var check = response.responseText; if (check) { var data = Ext.util.JSON.decode(response.responseText); if (data.SUCCESS == '1') { var getForm_machine = data.MACHINE; var getForm_template = data.TEMPLATE; var winTempl = new Ext.Window({ id: 'WinTempl', layout: 'fit', width: 750, height: 400, modal: true, title: 'Template:' + getForm_template + '/ Machine:' + getForm_machine, items: { xtype: 'metaform', autoScroll: true, url: 'vvcall.pgm', baseParams: { pgm: 'TDTK10R', action: 'getForm', machine: getForm_machine, template: getForm_template }, buttons: [{ text: 'Save', handler: function() { Ext.getCmp('WinTempl').items.get(0).getForm().submit({ success: function() { winTempl.close(); } }); } }] } }); winTempl.show(); } } }, failure: function(response) { Ext.getBody().unmask(); Ext.Msg.alert('Error', 'Function is not allowed'); } }); };
The link to the metaform code http://www.sencha.com/forum/showthre...ed-from-server
As always, i think i'm close to the solution, but elas in this case... this is beyond my current javascript/extjs knowledge..
i know it needs to be solved by replacing the 'special' values by their json-friendly-counterpart (i.e CRLF by \n) but my problem is: where should i put the code in !!!
i hope someone could help me on that !
Comment