Jump to content

How to Activate RowSelect using UniDBTreeGrid


Servant5166

Recommended Posts

Hi,

 

One possible solution, can you try this approach too ?!:

 

1. CustomCSS:

.custom-row .x-grid-cell {
    background-color: #B299CC !important;
}

.custom-row .x-grid-cell-selected  {
    background-color: greenyellow !important;
}

2. UniDBTreeGrid1 -> ClientEvents -> ExtEvents -> function select:

function select(sender, record, index, eOpts)
{
    
    if (record.id !== '_root') {
        var grid = this;
        grid.getView().el.select('tr.custom-row').removeCls('custom-row');
        var record = Ext.get(grid.getView().id + "-record" + record.id);
        if (record) {
            record.addCls('custom-row');
        }
    };
}

3. UniDBTreeGrid1 -> ClientEvents -> ExtEvents -> function itemexpand:

function itemexpand(sender, eOpts)
{
    if (sender.id !== '_root') {
        var grid = sender.store.grid;
        grid.getView().el.select('tr.custom-row').removeCls('custom-row');
        var record = Ext.get(grid.getView().id + "-record" + sender.id);
        if (record) {
            record.addCls('custom-row');
        }        
    };
}

4. UniDBTreeGrid1 -> ClientEvents -> ExtEvents -> function itemcollapse:

function itemcollapse(sender, eOpts)
{
    if (sender.id !== '_root') {
        var grid = sender.store.grid;
        grid.getView().el.select('tr.custom-row').removeCls('custom-row');
        var record = Ext.get(grid.getView().id + "-record" + sender.id);
        if (record) {
            record.addCls('custom-row');
        }        
    };
}

Result:

post-906-0-73057100-1515063119_thumb.png

 

Best regards,

Link to comment
Share on other sites

Hi,

 

One possible solution, can you try this approach too ?!:

 

1. CustomCSS:

.custom-row .x-grid-cell {
    background-color: #B299CC !important;
}

.custom-row .x-grid-cell-selected  {
    background-color: greenyellow !important;
}

2. UniDBTreeGrid1 -> ClientEvents -> ExtEvents -> function select:

function select(sender, record, index, eOpts)
{
    
    if (record.id !== '_root') {
        var grid = this;
        grid.getView().el.select('tr.custom-row').removeCls('custom-row');
        var record = Ext.get(grid.getView().id + "-record" + record.id);
        if (record) {
            record.addCls('custom-row');
        }
    };
}

3. UniDBTreeGrid1 -> ClientEvents -> ExtEvents -> function itemexpand:

function itemexpand(sender, eOpts)
{
    if (sender.id !== '_root') {
        var grid = sender.store.grid;
        grid.getView().el.select('tr.custom-row').removeCls('custom-row');
        var record = Ext.get(grid.getView().id + "-record" + sender.id);
        if (record) {
            record.addCls('custom-row');
        }        
    };
}

4. UniDBTreeGrid1 -> ClientEvents -> ExtEvents -> function itemcollapse:

function itemcollapse(sender, eOpts)
{
    if (sender.id !== '_root') {
        var grid = sender.store.grid;
        grid.getView().el.select('tr.custom-row').removeCls('custom-row');
        var record = Ext.get(grid.getView().id + "-record" + sender.id);
        if (record) {
            record.addCls('custom-row');
        }        
    };
}

Result:

attachicon.gifdbtreegridRowSelect.png

 

Best regards,

 

Thank you so much.

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