browse by category or date

Recently I was editing my Complete Singapore-Indonesia Ferry Schedule JSON data when I encountered a bug. I was editing an array of objects which is the property value of the parent JSON object. In JSON Table Editor terms, this means I am operating on a child window. Tired of scrolling ups and downs, I filtered the rows. I then edit some of the rows, then confirmed my changes.

But when I clicked , only the filtered rows were saved to main object, which is wrong. Rightfully, all rows should be saved to the main JSON object.

After few rounds of trial and error trying to solve this bug, this is my final solution:

// checkedOpener = true if it's a child window
// grid = Ext.grid.Panel instance

if (checkedOpener && grid.filters.getFilterData().length>0) {
    // innerOutput = function to either output the grid's data into 
    // JSON output or updating parent JSON field value
    grid.on('filterchange', innerOutput);
    grid.filters.clearFilters();
}
else
    innerOutput(); 

That’s all folks. Cheers!

GD Star Rating
loading...
JSON Table Editor Enhancements – Part 6, 3.0 out of 5 based on 1 rating

Possibly relevant:

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Incoming Search

bugs, extjs, javascript, json

No Comment

Add Your Comment