Jump to content


Photo

Simple TIP: CheckComboBox Plugin


  • Please log in to reply
4 replies to this topic

#1 estrify

estrify

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 341 posts

Posted 28 September 2015 - 03:26 PM

Hi,

 

I show a simple use of a CheckComboBox Plugin...

  • Add "CheckComboBox_Plugin.js" to UniServerModule->CustomFiles (adjust the path to the .JS file to yours)
  • Add the following to UniServerModule->CustomCSS (adjust the path to the .GIF file to yours):
    .ux-boundlist-item-checkbox
    {
        background-repeat: no-repeat;
        background-color: transparent;
        width: 13px;
        height: 13px;
        display: inline-block;
        line-height: 13px;
        background-image: url('checkbox.gif');
        background-position: 0 0;
    }
    .x-boundlist-selected .ux-boundlist-item-checkbox
    {
        background-position: 0 -13px;
    }
    
  • Add UniComboBox->ExtEvents->Ext.form.field.ComboBox -> change

    function change(sender, newValue, oldValue, eOpts)
    {
        for (var i=0; i<newValue.length; i++)
        {
           var found=false;
           
           for (var j=0; j<oldValue.length; j++)
             if (newValue[i]==oldValue[j])   { found=true; break;}
           
           if (!found)  ajaxRequest(sender, "checkevent", [ "text="+newValue[i] ]);
        }
    
        for (var i=0; i<oldValue.length; i++)
        {
           var found=false;
           
           for (var j=0; j<newValue.length; j++)
             if (oldValue[i]==newValue[j])   { found=true; break;}
           
           if (!found)  ajaxRequest(sender, "uncheckevent", [ "text="+oldValue[i] ]);
        }
    }
    
  • Add to UniComboBox->UniEvents -> Ext.form.Field.ComboBox -> beforeInit:

    function beforeInit(sender, config)
    {
       Ext.apply(sender, {
          emptyText: 'empty text',
          multiSelect: true,
          plugins: Ext.create('Ext.ux.form.plugin.CheckComboBox')
       });
    }
  • Look at Main.pas to see sample ways to do things...
     

I hope you find it useful to adapt it to your needs...

 

Regards,

 

 

 

Attached Files


  • 4

#2 stiaan

stiaan

    Advanced Member

  • Members
  • PipPipPipPip
  • 118 posts

Posted 06 October 2015 - 05:31 AM

Thanks!


  • 0

#3 _Mehmet_

_Mehmet_

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 486 posts
  • LocationAntalya / Turkey

Posted 06 October 2015 - 07:48 AM

Thanks


  • 0

#4 ma4balaka

ma4balaka

    Newbie

  • uniGUI Subscriber
  • Pip
  • 8 posts
  • LocationRussia

Posted 26 August 2016 - 08:19 AM

How to programmatically mark multiple positions?

The issue is canceled, I found the answer in the example


  • 0

#5 wildfoxwolf

wildfoxwolf

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 12 September 2017 - 02:43 PM

Something wrong when used in unidbgrid filter-editor,cell-editor.


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users