I want to do something like this:
Based on a condition I want to change how grid reads data. myRefresh(grd) may run anytime during runtime.
But as datasource is changed from static data to transport I get "t.transport.read is not a function" error which is proabaly because datasource.transport was not initially defined.
Do I have to recreate the grid? Or is there a shorter way?
function myRefresh(grd)
{
if(somecondition)
{
grd.datasource.transport = {
read: { someArguments }
}
}
grd.dataSource.read();
}
else
{
grd.dataSource.transport = undefined;
grd.dataSource.data(somedata);
}
}
Based on a condition I want to change how grid reads data. myRefresh(grd) may run anytime during runtime.
But as datasource is changed from static data to transport I get "t.transport.read is not a function" error which is proabaly because datasource.transport was not initially defined.
Do I have to recreate the grid? Or is there a shorter way?