Hi,
I have two datatables, one controls the filtering of the other. So in the first table I have:
$$('gasGrid').attachEvent("onafterSelect", function(id) {
$$('forecastHeader').show();
$$('forecastGrid').show();
// Get Currently Selected Row
var record = $$('gasGrid').getItem(id);
$$('forecastGrid').filter('#SiteFK#', record.SiteID);
$$('forecastHeader').define({template:record.SiteName});
$$('forecastHeader').refresh();
});
And this works fine, as you move through gasGrid the filtering is applied to forecastGrid.
However when I change a value in gasGrid I need to reload the data in forecast grid and re-applying the filter does not work. So I have this code:
$$('gasGrid').attachEvent("onAfterEditStop", function(state, editor) {
if (editor.column == 'GasForecastManual') {
if (state.old != state.value) {
$$('forecastGrid').clearAll();
$$('forecastGrid').load($$('forecastGrid').config.url);
var record = $$('gasGrid').getItem($$('gasGrid').getSelectedId());
$$('forecastGrid').filter('#SiteFK#', record.SiteID);
}
}
});
I have also tried doing $$(‘forecastGrid’).filterByAll(); but that doesn’t work either, the table contains all rows with no filtering applied.
Any ideas?
Thanks
Gary