Jump to content
uniGUI Discussion Forums
delagoutte

Full cell click and not only checkbox for multiselect : possible ?

Recommended Posts

Hello,

See picture please

post-892-0-03187100-1510588345_thumb.png

i have a grid with multiselect : true.

 

On image there is row 1 and 2 that are selected.

if i click on checkbox (1 on image) i'll have row 1,2,3 that will be selected.

but

if i click nearby chekc box in cell (2 in image) i'll have only row 3 that will be selected.

 

how can ido for having the click on part 2 = click on part 1 -> if i click on 2 on image that i'll have row 1,2,3 selected ? is it possible ?

Share this post


Link to post
Share on other sites

Hello,

 

Maybe like this ?!:

 

UniDBGrid -> ... function beforeitemclick:

function beforeitemclick(sender, record, item, index, e, eOpts)
{
    
    var _selModel=sender.getSelectionModel();
    var _selected=_selModel.isSelected(record);
    
    if (!_selected) {
        _selModel.select(record, true);
    } else {
        _selModel.deselect(record, false);
    }
    return false;
}

Best regards,

Share this post


Link to post
Share on other sites

Hello, 

it is not that i want.

With this code, it is working but if click on an other cell in the row the row is selected (as if i have press Ctrl+Click)

if i click on an other cell row, the other rows must be unselected.

 

I was wondering if i could do it with this config :

http://docs.sencha.com/extjs/4.2.5/#!/api/Ext.selection.CheckboxModel-cfg-checkSelector

 

i try this 

function checkboxModel.beforeInit(sender, config)
{
  config.checkSelector = "x-grid-row-checker";
}

x-grid-row-checker is the default value but I don't know what other values to put

Share this post


Link to post
Share on other sites

Another solution,

Can you try to use this approach for now ?!:

 

1. function beforeitemclick

 

2. function beforecellclick:

function beforecellclick(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) 
{
    if (cellIndex == 0) {
        var _selModel = sender.getSelectionModel();
        var _selected = _selModel.isSelected(record);

        if (!_selected) {
            _selModel.select(record, true);
        } else {
            _selModel.deselect(record, false);
        }
        return false
    }
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×