Aug 20, 2014, 1:02 PM
[CLOSED] Loop through TemplateHtml in RowExpander
I am take http://mvc.ext.net/#/GridPanel_RowExpander/Remote_Mode/ as an example .
and change GetData() function like bellow for multiple return value and show in RowExpander's TemplateHtml ,currently in example it will return single value display,How I display multiple records after expand?
RowExpander inside grid.where I add the loop in TemplateHtml
and change GetData() function like bellow for multiple return value and show in RowExpander's TemplateHtml ,currently in example it will return single value display,How I display multiple records after expand?
public ActionResult GetData(string company, int index)
{
var Questions = new List<jr>
{
new jr {company = "s1", index = "Q1,Q2",time=DateTime.Now.ToLongTimeString()},
new jr {company = "s2", index = "Q1,Q2,Q3",time=DateTime.Now.ToLongTimeString()},
new jr {company = "s3", index = "Q1,Q2,Q4",time=DateTime.Now.ToLongTimeString()},
new jr {company = "s4", index = "Q1,Q2,Q5",time=DateTime.Now.ToLongTimeString()},
};
JsonResult _jr = new JsonResult();
_jr.Data = Questions;
return _jr;
}
RowExpander inside grid.where I add the loop in TemplateHtml
.Plugins(
Html.X().RowExpander()
.Loader(Html.X().ComponentLoader()
.Mode(LoadMode.Data)
.Url(Url.Action("GetData"))
.LoadMask(mask => mask.ShowMask = true)
.Params(
new
{
company = JRawValue.From("this.record.data['company']"),
index = JRawValue.From("this.grid.store.indexOf(this.record)")
}
)
)
.TemplateHtml(@<text>
<span class="template">
Company: {company}, Row №: {index}, Server Date: {time}
</span>
</text>)
)
Last edited by matrixwebtech; Nov 05, 2014 at 12:02 PM.