BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
@(Html.EJ().Grid<object>("Grid")
.Datasource((IEnumerable<object>)ViewBag.dataSource)
.AllowPaging()
... .
.Columns(col =>
{
col.Field("OrderID").HeaderText("OrderID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();
. .. .
col.Field("ShipAddress")
.Template("<textarea rows='4' style='width:100%' cols=95%>{{:ShipAddress}}</textarea>")
.EditTemplate(a =>
{
a.Create("create")
.Read("read")
.Write("write");
}).Width(100).Add();
})
)
<script type="text/javascript">
function create() {
return $(" <div class='e-field'><textarea rows=3 style='width: 100%;'></textarea></div> "); //creating a textarea
}
function write(args) {
//add an id attribute to textarea and name them as "GridID" + "ColumnName"
//id==>GridShipContry
args.element.find("textarea").val(args.rowdata["ShipAddress"]).attr("id", args.element.attr("id")).attr("name", "ShipAddress"); //Writing the edited text value
}
function read(args) {
return args.val();//Getting the Edited text value
}
</script> |
@(Html.EJ().Grid<object>("Grid")
.Datasource((IEnumerable<object>)ViewBag.dataSource)
. . .
.Columns(col =>
{
. . . .
col.Field("ShipCity")
.Template("<textarea rows='4' style='width:100%' cols=95%>{{:ShipCity}}</textarea>")
.EditTemplate(a =>
{
a.Create("create")
.Read("read")
.Write("write");
}).Width(100).Add();
col.Field("Verified").Type("boolean").EditType(EditingType.Boolean).Width(100).Add();
})
)
<script type="text/javascript">
function create() {
return $("<textarea class='e-field' rows=3 style='width: 100%;'></textarea>"); //creating a textarea
}
function write(args) {
//add an id attribute to textarea and name them as "GridID" + "ColumnName"
//id==>GridShipContry
args.element.val(args.rowdata["ShipCity"]).attr("id", args.element.attr("id")).attr("name", "ShipCity"); //Writing the edited text value
}
function read(args) {
return args.val();//Getting the Edited text value
}
</script> |
<script type="text/javascript">
function create() {
return $("<textarea class='e-field' rows=3 style='width: 100%;'></textarea>"); //creating a textarea
}
function write(args) {
//add an id attribute to textarea and name them as "GridID" + "ColumnName"
//id==>GridShipContry
args.element.val(args.rowdata["ShipCity"]).attr("id", args.element.attr("id")).attr("name", "ShipCity"); //Writing the edited text value
}
function read(args) {
return args.val();//Getting the Edited text value
}
</script> |