Hi, How can introduce the radio button list in igHirerachicalgrid.
I did achieve it by template column but they do not work as all the buttons in the rows have same name and id. So is there a way to do so that they have different group name for each row and id's?
My sample code:
eSignaturegroup.Group.Add(new GridColumn() { Rowspan=2 , HeaderText = "In Person",Key = "eSign",DataType = "bool",Width = "10%",FormatterFunction = GetESign("InPerson") }); eSignaturegroup.Group.Add(new GridColumn() { HeaderText = "Remote",Key = "eSign",DataType = "bool",Width = "10%",FormatterFunction = GetESign("Remote") });
private string GetESign(string eSign) { var sb = new StringBuilder(); sb.Append(" function(obj){"); if (eSign.Equals("InPerson")) { sb.Append(" if (obj == 0 ){return ' <ul class=radio-group> <li><input id=InPerson_" + i + " name=esign_" + i + " type=radio checked=checked /> <label for=InPerson_" + i + "><span><span></span></span></label></li></ul>';}"); sb.Append(" if (obj == 1 ){return '<ul class=radio-group> <li><input id=InPerson_" + i + " name=esign_" + i + " type=radio /><label for=InPerson_" + i + "><span><span></span></span></label></li></ul>';}"); } else if (eSign.Equals("Remote")) { sb.Append(" if (obj == 1 ){ return '<ul class=radio-group> <li><input id=Remote_" + i + " name=esign_" + i + " type=radio checked=checked /><label for=Remote_" + i + "><span><span></span></span></label></li></ul>';} "); sb.Append(" if (obj == 0 ){return '<ul class=radio-group> <li><input id=Remote_" + i + " name=esign_" + i + " type=radio /><label for=Remote_" + i + "><span><span></span></span></label></li></ul>';}"); }; sb.Append("} "); return sb.ToString();
is there a way where I can send the row index so that it can work. Also how can I send the row index in this context?
Your help is much appreciated.
Hello Raghavendra,
Unfortunately this is not currently documented.
If you have any other questions or concerns, please feel free to contact me.
Hi Nikolay,
Thank you very much for the information, can you direct me to the documentation where it is mentioned in 2014.1 please?
Hi Raghavendra,
In igGrid the templating engine is executing the template separately for each row/column, it is not working with arrays of rows/columns. That's why the index is always 0.
I changed my code now but I don't see the answer for the below question.
The $i is not getting incremented for each row, it is always zero. If I can get it increasing, then I can move to template column
Hi,
If you want unique ids for each button, I'd suggest you to use the primary key column, for example:
id='btn_${ProductID}'
Hope this helps.