Jump to content

unidbgrid combo filter multi select in 1 time


Didier

Recommended Posts

Hello,

I've a unidbgrid with a lot of columns.

When i want to filter on one witch have checkbox, i can't check 2-3 or more at the same time.

I check one -> the combo close and my grid is updating.

i must re open filter to check on other and other ...

Can i put a button "validate" on my filter combo ?

or check everything i want and when i click somewhere, the combo close and apply filter ?

 

Thank you

 

Didier

 

Link to comment
Share on other sites

  • Didier changed the title to unidbgrid combo filter multi select in 1 time

ok, my code is very old...

i put unicombobox in filtereditor. I think unicheckcombobox didn't exist when this was made.

and by code i changed my unicombobox into unicheckcombobox..

so now i ll try to use. it is ok :)

But just one things now.

how can i change the width of my combobox.

the title is small : 'Dpt'

but list of the check combo is like this :

'64 - Pyrénée' (or higer)

..

i want to see all the line without return
 

i ve this code but it not works (it was for the unicombox):
  aUniCombobox.ClientEvents.UniEvents.Values['beforeInit']:=
    'function beforeInit(sender, config)'+#13#10+
    '{'+#13#10+
    '    Ext.apply(sender, {'+#13#10+
    '        multiSelect: true,'+#13#10+
    '        plugins: []'+#13#10+
    '    });'+#13#10+
    '    config.listConfig = {'+#13#10+
    '        listeners: {'+#13#10+
    '            show: function(picker) {'+#13#10+
    '                picker.setMinWidth(picker.listEl.getTextWidth() + 20);'+#13#10+
    '            }'+#13#10+
    '        }'+#13#10+
    '    }; '+#13#10+
    '}';

Link to comment
Share on other sites

i just add :
  UniCheckComboBox2.Items.Add('Triggerfish');
  UniCheckComboBox2.Items.Add('Wrasse');
  UniCheckComboBox2.Items.Add('Cod');
  UniCheckComboBox2.Items.Add('Shark');
  UniCheckComboBox2.Items.Add('4 - Alpes de Hte Provence');

MatchFieldWidth : true or false -> it's the same

 

image.png.3bcba34f6d69a049b9a9590a15edd3c0.png

Link to comment
Share on other sites

hello,

 

i can reproduce on your test :

add line here :

  UniCheckComboBox1.Selected[0] := True;
  UniCheckComboBox1.Selected[2] := True;
  UniCheckComboBox2.Items.Add('Triggerfish');
  UniCheckComboBox2.Items.Add('Wrasse');
  UniCheckComboBox2.Items.Add('Cod');
  UniCheckComboBox2.Items.Add('Shark');
  UniCheckComboBox2.Items.AddObject('Alpes de Hte Provence',TObject(Integer('4')));
  UniCheckComboBox2.Items.Add('Triggerfish');
  UniCheckComboBox2.Items.Add('Wrasse');
  UniCheckComboBox2.Items.Add('Cod');
  UniCheckComboBox2.Items.Add('Shark');
  UniCheckComboBox2.Items.AddObject('Alpes de Hte Provence',TObject(Integer('4')));
  UniCheckComboBox2.Items.Add('Triggerfish');
  UniCheckComboBox2.Items.Add('Wrasse');
  UniCheckComboBox2.Items.Add('Cod');
  UniCheckComboBox2.Items.Add('Shark');
  UniCheckComboBox2.Items.AddObject('Alpes de Hte Provence',TObject(Integer('4')));

and you'll get my problem ->the scroll bar

only on firefox, i don't have the problem on chrome

Link to comment
Share on other sites

You can try this approach:

UniCheckComboBox.ClientEvents.UniEvents ->

function beforeInit(sender, config) 
{
    if (config.matchFieldWidth == false) {
        config.listConfig.listeners = {
            beforeshow: function(picker) {
                var itemWA = [];
                sender.getStore().getData().getRange().forEach(function(item) {
                    itemWA.push(Ext.util.TextMetrics.measure(picker.getId(), item.getData().val).width);
                });
                picker.minWidth = Math.max(...itemWA) + 70
            }
        }
    }
}

 

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