PDA

View Full Version : Edit data when export to Excel



xDroid
Jan 11, 2017, 8:12 AM
Hi

Using EXT.NET 4, but the question is not EXT.NET specific i think

In this example
http://examples1.ext.net/#/GridPanel/Miscellaneous/Export_Data_PostBack/

If you want to change the Company Name, where will i do it?

Something like this:

if (data=="American Express Company"){
NewCompanyName="Amex";
}

And i want the NewCompanyName exported to Excel.

Understand?! :-)

Reegards

Johan

fabricio.murta
Jan 24, 2017, 10:03 PM
Hello @xDroid!

Please enclose code blocks withing
blocks, it makes it indentable and much more readable. Would you mind editing your post to fix it?

You say you are using Ext.NET 4 but point us to Ext.NET 1 example. Well, I just took the equivalent Ext.NET 4 example (http://examples4.ext.net/#/GridPanel/Miscellaneous/Export_Data_PostBack/) and updated the record as it seems your pseudocode suggested. This could be done (among other ways of course) with a script like this:



var recId = App.GridPanel1.store.findExact("company", "American Express Company"),
view = App.GridPanel1.getView();

if (recId >= 0) {
var rec = App.GridPanel1.store.getAt(recId).data;
rec.company = "AMEX";
view.refresh();
} else {
console.log("not found.");
}


Hope this helps!