Hello, I hava a listgrid with a datasouce with localData. I change de datasouce but I don't know how I have to do for the new data appear on listGrid. I've try with refres() and reset() but this doesn't do anything.
Please tell me something.
The code is:
<b:dataSource name='dsEncuestas' e:behavior="b:localData" dataType="application/xml">
<b:dataContainer id="datos">
<xi:include href="getReferencias.php" />
</b:dataContainer>
</b:dataSource>
<b:listGrid id="lista" width="auto" height="100%" readonly="true" rowClasses="rowClass1, rowClass2" dataSource="dsEncuestas" >
..
</b:listGrid>
<b:dataContainer id="datos">
<xi:include href="getReferencias.php" />
</b:dataContainer>
</b:dataSource>
<b:listGrid id="lista" width="auto" height="100%" readonly="true" rowClasses="rowClass1, rowClass2" dataSource="dsEncuestas" >
..
</b:listGrid>
and I change the data this way:
var fnSuccess = function (oRequest,oElement){
alert("ok");
}
var fnError = function (oRequest,oElement){
alert("ko");
}
//datasource
var dsdatos= bb.document.getElementById('dsEncuestas');
bb.command.load(url,"GET",null, null,dsdatos,'replaceChildren',fnSuccess,fnError);
var oListGrid=bb.document.getElementById('lista');
oListGrid.reset();

Refresh a datasource on a listGrid
14 December, 2007 - 14:33 — yudiHi Laura,
You can try the following example to refresh the data.This example is using remoteData and get/refresh the data from the server every time the user click the button.
<e:handler event="click" type="application/javascript">
var listGrid = bb.document.getElementById('listGrid');
listGrid.refresh();
</e:handler>
</button>
<b:listGrid id="listGrid" width="auto" height="100%" readonly="true" rowClasses="rowClass1, rowClass2">
<b:dataSource e:behavior="b:remoteData" url="gridData.xml" dataType="application/xml"/>
<b:listGridCol select="title" label="Title" width="200px" />
<b:listGridCol select="genre" label="Genre" width="100px" />
<b:listGridCol select="rating" label="Rating" width="70px" align="right" />
</b:listGrid>
Yes, I have made remote data
17 December, 2007 - 08:27 — LauraYes, I have made remote data but the problem with this is to order the listgrid. Do you know how refresh a localdata listGrid?
Refresh a datasource localData on a listGrid
18 December, 2007 - 17:17 — EmielHi Laura,
It is not possible to refresh localData on a listGrid. There should not be need to refresh localData because it is local and there is nothing to refresh it to. You should check out the example I sent to Fernando. That has an example with a remoteData and a sort option.
it's possible
19 December, 2007 - 17:14 — TedBeerActually it's possible.
<e:data type="application/xml">
<xi:include href="getReferencias.php" />
</e:data>
</e:variable>
<b:dataSource name='dsEncuestas' e:behavior="b:localData" dataSelect="$myData" />
<b:listGrid id="lista" dataSource="dsEncuestas" >
..
</b:listGrid>
<button>load new data
<e:handler event="click">
<c:load url="new_data.xml" destination="." />
<e:call with="id('lista')" method="refresh" />
</e:handler>
</button>
and new_data.xml contains:
<e:data type="application/xml">
... actual data ...
</e:data>
</e:variable>
New variable replaces old one.
PS. Be aware that bb.command.load could load data asynchronously which is default. And listGrid 'refresh' method call is fulfiled before your data is loaded.
thanks TedBeer
29 January, 2008 - 12:09 — uurienThanks TedBeer, I'm trying do it more than two months, this is the best post that I ever read :D
thanks!
Thank you all :)
5 March, 2008 - 22:08 — niksaI have problems with the same thing, but now I don't :)
Thank you all again
Grid refresh
5 March, 2008 - 23:55 — JoopForget this one for now.