Jump to content

How can I enable only the field that has the editor enabled?


Recommended Posts

How can I enable only the field that has the editor enabled?
It is enabling all other fields in the edition and allowing to change the same defined fields or readonly = true in each field of the grid

image.png.ed72963cb0a95cb1b1e2b46fddaaab6c.png

image.png.098fe0ac7a28af71a491b3559e725447.png  image.png.d85fd5b8bb310f740519f54a49e82be7.png  

And why does the image appear in her html, as shown in the image?

image.png.29ebf8984c6e6922e2256442f991c0a6.png

  • Like 1
  • Upvote 1
Link to post
Share on other sites
5 hours ago, robinhodemorais said:

Any solution ?

Try this workaround for now:

function afterrender(sender, eOpts)
{
    var me=sender;
    if (me.editingPlugin.isRowEditor) {
        
        me.editingPlugin.editorCfg.listeners = {
            show: function(a) {
                a.items.each(function(f) {
                    f.setEditable(!f.column.rdonly)
                })
            }
        };
    };
}

 

Link to post
Share on other sites
  • 3 months later...

Perfect... 

On 7/30/2020 at 1:46 AM, Sherzod said:

Try this workaround for now:


function afterrender(sender, eOpts)
{
    var me=sender;
    if (me.editingPlugin.isRowEditor) {
        
        me.editingPlugin.editorCfg.listeners = {
            show: function(a) {
                a.items.each(function(f) {
                    f.setEditable(!f.column.rdonly)
                })
            }
        };
    };
}

 

Perfect. This problem will be solved in the next update?

Link to post
Share on other sites
  • 1 month later...
6 hours ago, molla2005b said:

it's not work

Hello,

Can you try to use this approach?

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    columns.forEach(function(col){
        if (col.getEditor() && col.rdonly) {
            col.getEditor().setDisabled(col.rdonly);
        }
    })
}

 

  • Like 2
Link to post
Share on other sites
1 hour ago, Sherzod said:

Hello,

Can you try to use this approach?


function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    columns.forEach(function(col){
        if (col.getEditor() && col.rdonly) {
            col.getEditor().setDisabled(col.rdonly);
        }
    })
}

 

Thanks, that worked.

  • Like 1
Link to post
Share on other sites
4 hours ago, Sherzod said:

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { columns.forEach(function(col){ if (col.getEditor() && col.rdonly) { col.getEditor().setDisabled(col.rdonly); } }) }

Its works, thanks!

another situation in 1.90.0.1542

image.thumb.png.203e954b952193a18b90590ca79f3096.png

 

image.png.dcf9f1ced963198c7ab581fa56cecd94.png

 

 

  • Like 1
Link to post
Share on other sites
  • 1 month later...

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...