content inside rowexpander template won't update
hi there i have a grid panel, the problem is if i call a server side update of the grid panel content, the content of the grid row is updated, but the text inside the row expander does not get updated.
server side update
Code:
[AjaxMethod]
public void bindQuestionSetContent_AM()
{
int pqsid = Convert.ToInt32(hdnParentWinQSID.Value);
try
{
bindQuestionSetContent(pqsid, ....................);
extgpMyQS_SelectionModel.ClearSelections();
}
catch
{
bindQuestionSetContent(pqsid);
}
}
private void bindQuestionSetContent(int pqsid, int selectedview)
{
try
{
DataTable dtMyQSContent = ...............;
extstorePQS.DataSource = dtMyQSContent;
extstorePQS.DataBind();
}
catch (Exception ex)
{
.....................
}
}
Code:
<ext:RowExpander ID="RowExpander1" runat="server" ColumnPosition="1" >
<Template ID="Template1" runat="server">
<p>About this Question: {description}</p>
</Template>
<Listeners>
<BeforeExpand Fn="descriptionExpanded" />
<Expand Fn="descriptionExpandedDone" />
</Listeners>
</ext:RowExpander>
<ext:GridPanelMaintainScrollPositionOnRefresh runat="server"></ext:GridPanelMaintainScrollPositionOnRefresh>
{description} does not get updated
RE: content inside rowexpander template won't update
i tried deleting the cache but the old value still persists on the row expander the content... the only time it gets an updated value is when i reload the whole page, but it is not getting updated if i do an update using an ajaxmethod
please note that i am using coolite v.0.8.2
RE: content inside rowexpander template won't update
Hi,
Try to add the following custom config to the RowExpander plugin
Code:
<ext:ConfigItem Name="enableCaching" Value="false" Mode="Raw" />
RE: content inside rowexpander template won't update
ok, that solves it but the row expander content gets removed after grid reload whenever the row expander is expanded
RE: content inside rowexpander template won't update
Hi,
Then remove enableCaching and register the following script after data rebinding
Code:
GridPanel1.AddScript("{0}.view.refreshRow({0}.store.getById('{1}'));", GridPanel1.ClientID, RequiredRecordId);
RE: content inside rowexpander template won't update
the store.getById('{1}') uses the recordID column right? not necessarily the column with the name "id"
RE: content inside rowexpander template won't update
i may not be able to get the record id of that row because of some complicated thing, i now resorted to just updating the row body on row expander expand, the problem is it still won't change even if i do this on the beforeexpand listener
Code:
expandedRow = rowIndex;
var row = expander.grid.view.getRow(rowIndex);
var body = Ext.DomQuery.selectNode('tr div.x-grid3-row-body', row);
body.innerHTML = "<p>About this Question:" + record.get("description") + "</p>";
record.get("description") is already updated when the function is triggered but doing body.innerHTML doesn't seem to change the row expander body
RE: content inside rowexpander template won't update
Hi,
If you don't id then use row index
Code:
GridPanel1.AddScript("{0}.view.refreshRow({0}.store.getAt({1}));", GridPanel1.ClientID, Index);
RE: content inside rowexpander template won't update
i am calling this on the row expander rowExpanded listener but it is not updating
Code:
expander.grid.view.refreshRow(expander.grid.store.getAt(rowIndex));
RE: content inside rowexpander template won't update
Hi,
You have to call it after data rebinding, for example in the success handler of the AjaxMethod which rebinds data