Hello Syncfusion team,I have an ejGrid (13.3.0.7) with remote databind.I have a childgrid also (with remote databind).This is my code:public JsonResult getPermessiLavoro(DataManager dm)@(Html.EJ().Grid<Ponteggio>("tbListaPonteggi").Datasource(ds => ds.URL(Url.Action("getListaPonteggi", "Registro")).Adaptor(AdaptorType.UrlAdaptor)).Columns(col =>{col.Field("id_ponteggio").IsPrimaryKey(true).Visible(false).Add();col.Field("id_server").Visible(false).Add();col.Field("Nome").HeaderText("Nome ponteggio").Add();}).ChildGrid<PermessoLavoro>(child =>{child.Datasource(ds => ds.URL(Url.Action("getPermessiLavoro", "Registro")).Adaptor(AdaptorType.UrlAdaptor) ).QueryString("id_ponteggio").Columns(col =>{col.Field("id_permesso_lavoro").IsPrimaryKey(true).Visible(false).Add();col.Field("Numero").HeaderText(NomiColonne.colNumPermessoLavoro).Width(100).Add();});}))When the user expands a row in the parentgrid, I use this code to get the QueryString value (used to get childgrid):[HttpPost]
{
int id_ponteggio = Convert.ToInt32(dm.Where[0].value);//...}However, I need to pass the 'id_server' field (of the main row) also.I try with:.ChildGrid<PermessoLavoro>(child =>{child.Datasource(ds => ds.URL(Url.Action("getPermessiLavoro", "Registro")).Adaptor(AdaptorType.UrlAdaptor) ).QueryString("id_ponteggio, id_server")......but doesn't work.How can I solve this problem?I readp.s. I'm sorry for bad english
@(Html.EJ().Grid<object>("ParentGrid") … .ChildGrid(childnew => { childnew.Datasource(ds => ds.URL("/Home/ChildData")
.Adaptor(AdaptorType.UrlAdaptor)) .QueryString("EmployeeID") .ClientSideEvents(eve => eve.Load("childLoad")) … }))
<script> function childLoad(args) { // we can get Parent details in parentDetails property var data = this.model.parentDetails.parentRowData.ShipCountry; this.model.query.addParams("Country", data); } </script>
public ActionResult ChildData(DataManager dm, string Country) { … } |
Hi Omar,
Thanks for your update.
We are happy that the provided information helped you.
Regards,
Saravanan A.
<script>
function childLoad(args) {
// we can get Parent details in parentDetails property
var data = this.model.parentDetails.parentRowData.CourseCrn;
this.model.query.addParams("CRN", data);
}
</script>
function childLoad(args) {
var data = this.model.parentDetails.parentRowData.{YourField};
if (this.model.query == null) {
this.model.query = new ej.Query();
}
this.model.query.addParams("{yourParamName}", data);
}