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
175
disabled column still opens edit dialog
posted

Hi,

how disable "done, cancel" editor  row popup for disabled columns for editing?

When I click disabled columns still getting this.

features: [
        {
            name: 'Updating', 
columnSettings: [
{ columnKey: "ProductName", editorOptions: {readOnly: true, disabled: true}
Parents
No Data
Reply
  • 17590
    Verified Answer
    Offline posted

    Hello Andrew,

    In order to set a column to be read only column`s readOnly property should be set to true(rather than its editor`s readOnly option). 

    However, even if the column is set to readOnly if the edit mode of the grid is set to "row" (this is the default one) a click on this column will trigger edit mode. The reason why is that the entire rows is consuming the click event. 

    What I can suggest in case that you do not want to trigger edit mode from clicking on readOnly cell is handling editRowStarting event, which is cancelable. In this event you could check click on which column triggered the event and if this is the read only column to cancel it by returning false. For example:

    features: [
    				{
    					name: "Updating",
    					columnSettings: [
    						{
    							 columnKey: "Name",
    							 readOnly: true
    						}
    					],
    					editRowStarting: function(evt, ui){ 
    						var colKey = $(evt.currentTarget).attr("aria-describedby").substr(evt.target.id.length + 1);
    						if(colKey === "Name"){
    							return false;
    						}
    					}
    				},

    Attached you will find a small sample illustrating my suggestion for your reference.

    Please let me know if you need any further assistance with this matter.

    1781.igGridCancelUpdatingFromReadOnlyCell.zip

Children