Dear Infragistics Gurus,
Good morning.
In relate to my prvevious post regarding RowEditTemplates. I would just like to ask if its possible to create a custom layout with the RowEditTemplate window that opens? Can I re-layout it and add some images? I am actually thinking of adding some images related to the description information being editted by the user. Can it be done using the RowEditTemplate or another option is use the iDialog window and do some of the CRUD operations using the iDialog?
Thanks in advance Infragistic Gurus :)
Hello Almond,
In order to customize the edit template you can just access the dialog element in the rowEditDialogContentsRendered event. Once you have the dialog element you can append the image that you want to it.
For example this line will append an image just below the editable fields:
in js:
//Bind after initialization
$(document).delegate("#grid1", "iggridupdatingroweditdialogcontentsrendered", function (evt, ui) {
ui.dialogElement.children('.ui-dialog-content').append('<img src="http://localhost:39783/Images/tick.png" />');
});
if you want to access the titlebar you could try:
ui.dialogElement.children('.ui-dialog-titlebar')
with this lime you could access the buttons:
ui.dialogElement.children('.ui-dialog-buttonpane')
More about the customizing of the dialog you could find in our documentation:
http://help.infragistics.com/Help/NetAdvantage/jQuery/2012.2/CLR4.0/html/igGrid_Updating_RowEditTemplate_Configuring.html
Please let me know if this helps.
Hello Lybo,
Much thanks agian for the reply.
I am actually a newbie in MVC and having a hard time in adjusting your code :)
Could you possibly help me with my code below:
@(Html.Infragistics().Loader()
.ScriptPath(Url.Content("~/Scripts/IG/js/"))
.CssPath(Url.Content("~/Content/IG/css/"))
.Theme("metro")
.Resources("igShared")
.Render())
<script type="text/javascript">
var updates;
var grid = $('#grid1');
$.ig.loader(function () {
$("#saveChanges").igButton({ labelText: $("#saveChanges").val(), disabled: true });
$("#undo").igButton({ labelText: $("#undo").val(), disabled: true });
$("#redo").igButton({ labelText: $("#redo").val(), disabled: true });
grid.live("iggridupdatingrowdeleted", function (e, args) {
$("#undo").igButton("option", "disabled", false);
$("#saveChanges").igButton("option", "disabled", false);
grid.bind("iggridupdatingeditrowended", function (e, args) {
if (args.update) {
}
$("#undo").live('igbuttonclick',function (e, args) {
updates = grid.data('igGrid').dataSource.allTransactions();
grid.igGrid("rollback", true);
$("#redo").igButton("option", "disabled", false);
$("#undo").igButton("disable");
$("#saveChanges").igButton("disable");
return false;
);
$("#redo").live('igbuttonclick',function (e) {
$.each(updates, function (index, transaction) {
switch (transaction.type) {
case "row":
$('#grid1').igGridUpdating('updateRow', transaction.rowId, transaction.row, null, false);
break;
case "newrow":
$('#grid1').igGridUpdating('addRow', transaction.row, false);
case "deleterow":
$('#grid1').igGridUpdating('deleteRow', transaction.rowId, false);
$(this).igButton("disable");
$("#saveChanges").live('igbuttonclick',function (e) {
$("#grid1").igGrid("saveChanges");
$("#grid1").live("iggridupdatingroweditdialogclosed", function (event, ui) {
if (event.buttons == 0) {
} else {
$("#undo").igButton("option", "disabled", true);
$("#saveChanges").igButton("option", "disabled", true);
$("#grid1").live("iggridupdatingdatadirty", function (event, ui) {
$("#grid1").igGrid("commit");
</script>
@{ ViewBag.Title = "List of Branches";}
@(Html.Infragistics().Grid<csis2013Mvc3.tbl_branches>()
.ID("grid1")
.PrimaryKey("branch_idno")
.AutoGenerateColumns(false)
.AutoGenerateLayouts(false)
.AutoCommit(false)
.UpdateUrl(Url.Action("EditingBranches"))
.Columns(column =>
{
column.For(x => x.branch_idno).DataType("number").Hidden(true);
column.For(x => x.branch_code).HeaderText("CODE: ").DataType("string");
column.For(x => x.branch_location).HeaderText("LOCATION: ").DataType("string");
column.For(x => x.branch_chapel_desc).HeaderText("DESCRIPTION: ").DataType("string");
column.For(x => x.branch_contactperson).HeaderText("CONTACT PERSON: ").DataType("string");
column.For(x => x.branch_contactno).HeaderText("CONTACT NO.: ").DataType("string");
})
.Features(feature =>
feature.Selection().Mode(SelectionMode.Row).MultipleSelection(false);
feature.Sorting().Type(OpType.Local);
feature.Paging().PageSize(10).PrevPageLabelText("Previous").NextPageLabelText("Next");
feature.Filtering().Type(OpType.Local);
feature.Updating().EnableAddRow(true).EnableDeleteRow(true)
.EditMode(GridEditMode.RowEditTemplate)
.RowEditDialogContainment("owner")
.RowEditDialogWidth("375px")
.RowEditDialogHeight("275px")
.RowEditDialogOkCancelButtonWidth("100px")
.RowEditDialogFieldWidth("200px")
.ShowReadonlyEditors(false);
.Virtualization(false)
.ClientDataSourceType(ClientDataSourceType.JSON)
.DataSourceUrl(Url.Action("BranchList"))
.ResponseDataKey("")
.Height("100%")
.DataBind()
<br/>
<button id="saveChanges" value="@Resources.SAVE_CHANGES"></button>
<button id="undo" value="@Resources.UNDO"></button>
<button id="redo" value="@Resources.REDO"></button>
Thanks in advance for the help and good day once again.
almond :)
hi Almond,
The customized code is completely done in the front end, so in case of MVC scenario it will work.
You will just need to use the MVC wrapper to configure the grid.
Please let me know if you need further assistance.
regards
Lyubo
Hello Lyubo,
Much thanks for the link. Would just like to inquire if the code will also work for MVC projects?
Thanks and good day once again.
Almond
Please, take a look at this thread and let me know if it helps you.
http://ko.infragistics.com/community/forums/p/76453/386971.aspx