Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1300
Image in Edit mode is hiding
posted

Hi

I am using Jquery iggrid in my application and i have placed an "edit Image button" in it for opening the row data in a jquery poup but when ever i am double click on the row the inline editmode is appearing and the Image column is coming in edit mode, which i don't required .

I have to make the Image column as non-editable so i try to make the column as read-only and disable also but no good.

Here is the sample code

  $("#gridigGrid({
            height: height,
            primaryKey: "PkID",
            columns: [
               
                { headerText: "Address", key: "Address", dataType: "string", width: "220px", formatter: formatAddress },
               
                { headerText: "Edit", key: "Valuation", dataType: "image", width: "50px", display: "none", template: "<img alt='Img' title='title' id='delete-${PkID}' src='/Images/Preview.png' style='padding-left: 10px;' onclick='return PopupOpen(${PkID})' ></img>" },
            ],
            autoGenerateColumns: false,

            dataType: "JSON",

            dataSource: data
             features: [
            {
            name: "Updating",
            enableAddRow: false,
            editMode: "row",
            enableDeleteRow: false,
            columnSettings: [
            
            { columnKey: "Address", editorOptions: { type: "string", disabled: true, display: "none" } },
            { columnKey: "Valuation", editorOptions: { type: "string", disabled: true, display: "none" } },
            
            ]
            }
            ]
            }));

Thanks

Pradeep

Parents
  • 23953
    Offline posted

    Hello Pradeep,

    igGrid Updating is listening for key and mouse events in order to enter edit mode. By default updating enters edit mode on "click,f2,enter". The result is that when you click on the image the grid will enter edit mode, because it listens for click events.

    You have 2 options to deal with this:

    1.Customize when updating enters edit mode with the igGridUpdating.startEditTriggers option. 
    For example if you want to disable entering edit mode use the following code:

    startEditTriggers: "" 

    2. Cancel the click event bubbling by calling event.stopPropagation() in the PopupOpen function.

    Hope this helps,
    Martin Pavlov
    Infragistics, Inc. 

  • 1300
    Offline posted in reply to Martin Pavlov

    Hi Martin,

    Thanks for your reply. As you are suggesting to use  startEditTriggers: "" or event.stopPropagation() , but if i use the startEditTriggers: "" then the the grid become uneditable. but i have to use both inline editing and the Image column should be read only.

    Thanks

    Pradeep

Reply Children