Jump to content

UniDBGrid UniDBGrid1.ReadOnly := False; Not working


pro_imaj

Recommended Posts

Hello,

The problem is when you examine the attached example.


When the program first opens, you can double-click on the gray and change something.
But if you press the ReadyOnly = True button from the buttons below and then press the ReadyOnly = False button again, when you want to edit the Grid, RowEditor opens, but you cannot edit.

How do I solve this?

GridEditors - Row Editor.zip

Link to comment
Share on other sites

12 hours ago, pro_imaj said:

How do I solve this?

Can you try this workaround?

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) 
{
    sender.getColumnManager().getColumns().forEach(function(col, i) {
        var field = sender.editingPlugin.getEditor().getForm().getFields().items.find(x => x.column.dataIndex === col.dataIndex);
        if (field) {
            field.readOnly = col.rdonly;
            if (field.readOnly === false) {
                try {
                    field.inputEl.dom.removeAttribute('readonly')
                } catch (err) {}
            } else {
                try {
                    field.inputEl.dom.setAttribute('readonly', 'readonly')
                } catch (err) {}
            }
        }
    });
}

 

Link to comment
Share on other sites

7 hours ago, Sherzod said:

Can you try this workaround?

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) 
{
    sender.getColumnManager().getColumns().forEach(function(col, i) {
        var field = sender.editingPlugin.getEditor().getForm().getFields().items.find(x => x.column.dataIndex === col.dataIndex);
        if (field) {
            field.readOnly = col.rdonly;
            if (field.readOnly === false) {
                try {
                    field.inputEl.dom.removeAttribute('readonly')
                } catch (err) {}
            } else {
                try {
                    field.inputEl.dom.setAttribute('readonly', 'readonly')
                } catch (err) {}
            }
        }
    });
}

 

What event should I write about?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...