Jump to content

estrify

uniGUI Subscriber
  • Posts

    454
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by estrify

  1. Thanks for the answer...

     

    The plugin is very useful but I need to adjust paging automatically to the available space exactly ... This is why I need the height of different components to calculate the number of lines to be displayed avoiding to show grid's vertical scroll bar... I have already achieved it... Thanks a lot..

     

    Regards,

  2. Probably you need to call Refresh method of Grid.

     

    Thanks for response. But by now, this is insufficient...

     

    However, I have found a way to workaround this... Please, consider add the dynamic changing of the PageSize as a new feature... By now, here is how to achieve it:

    dbgrd.WebOptions.PageSize:=iNewPageSize; /* for now this has no effect. Only to be "clean" */
    UniSession.AddJS(
        dbgrd.JSName+'.getStore().pageSize='+IntToStr(iNewPageSize)+';'+
        dbgrd.JSName+'.getStore().load({params: { limit: '+IntToStr(iNewPageSize)+' }});'+
        dbgrd.JSName+'.getView().refresh();'
    );
    

    One more question: in UniDBGrid, is there a way to retrieve the total height of headers (considering grouping and so on) and the pager??

     

    Regards,

     

     

    • Upvote 1
  3. Hi,

     

    I have a paged dbgrid that has akRight and akBottom anchors. At runtime, when I change PageSize of the grid to adapt its content to the available space after a form resizing, the paging bar does not update its initial parameters. How can I update them?. Sure I am missing something trivial but if not, is there a workaround to achieve this result??

     

    Thanks in advance...

     

  4. Hi,

     

    The following might help you: add into   Your form -> ClientEvents -> UniEvents -> Ext.window.Window -> window.beforeInit  the following line:

     

       sender.constrainHeader = true;

     

    Regards,

  5.  

    I have 

     

    Main form and LoginForm

    TfEncryptLink_LoginForm = class(TUniLoginForm)
    

     

    Are Main form and LoginForm derived from TUniLoginForm?...

    Make sure that only one form is derived from TUniLoginForm and all your forms (login one also) are correctly registered (initialization section with its RegisterAppFormClass)...

  6. hi.

     

    in a unibutton onclick event:

     

    messagedlg('ERROR', mterror, [mbok], 0); <- this shows the message in the server side

     

    showmessage('ERROR'); <- this shows the message in the client side

     

    showmessage has less funcionalility than messagedlg.

     

    Hi,

    I think this is related to a simple namespace problem. This messagedlg you indicate is executing a Dialogs.MessageDlg function, not unigui's one... Look at example suggested by Delphi Developer...

    Regards,

  7. Hi,

     

    For some combobox I am using, I need to make the picker wider than the combo itself (see image). If you need something similar, add the following code to your combo:

     

    Within  "Combobox  ->  UniEvents  ->  Ext.form.field.Combobox  ->  afterCreate",  add the following

    function afterCreate(sender)
    {
      Ext.apply(sender, {
        matchFieldWidth: false,
        pickerOffset: [0,-1]
      });
    
      var picker;
      picker=sender.getPicker();
      picker.maxWidth=sender.width*2;  // Here, change the multiplier to adjust it to your needs, 
                                       // or directly specify a width
      picker.border=1;
    }
    
    

    Best regards,

    post-743-0-26740100-1450265766_thumb.png

    post-743-0-91808600-1450265786_thumb.png

    • Upvote 1
  8. 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,

     

     

     

    20150928_CheckComboBox_Plugin.rar

    • Upvote 6
  9. Hi,

    Is there a way to extend OnRemoteQuery?... I need to calculate a new string proporty each time RemoteQuery is called (a kind of persistant query string) but I don't find the way.

    Is there another way to do that?

    TIA

  10. Hi,

    Please, might you tell me hoy to override "OnAjax" event in a TUniComboBox?? ... (I have overrided it successfully in a TUniEdit but don't know how to proceed within a TUniComboBox)

    TIA

    Sorry... It's my fault... Restarting IDE compiles correctly...

  11. Hi,

    Please, might you tell me hoy to override "OnAjax" event in a TUniComboBox?? ... (I have overrided it successfully in a TUniEdit but don't know how to proceed within a TUniComboBox)

    TIA

  12. Hi,

    Please, it is possible to override OnAjaxEvent when extending components??...

    TIA

    Found:     procedure DoHandleEvent(AEventName: String; AParams: TUniStrings); override;

  13. Hi,

    I am making some tests with custom components. How can I use a plugin with them??...

    i.e. I want to extend TUniEdit to use ClearButton plugin... Using a normal TUniEdit and ClientEvents it is easy, but I don't know how to make it work directly in a custom component...

     

    in WebCreate the following produce ajax error:

    JSConfig('plugins', ['Ext.create("Ext.ux.form.field.ClearButton", {serverSideClear: false})']);

     

    TIA

     

    Sorry... It's my fault... Simply have to use:

    JSProperty('plugins', 'Ext.create("Ext.ux.form.field.ClearButton", {serverSideClear: false})');

  14. Hi,

    I am making some tests with custom components. How can I use a plugin with them??...

    i.e. I want to extend TUniEdit to use ClearButton plugin... Using a normal TUniEdit and ClientEvents it is easy, but I don't know how to make it work directly in a custom component...

     

    in WebCreate the following produce ajax error:

    JSConfig('plugins', ['Ext.create("Ext.ux.form.field.ClearButton", {serverSideClear: false})']);

     

    TIA

  15. Gracias Rasaliad por el interes mostrado.

     

    Por supuesto que no. Cuando inicio la aplicación solamente habro el frame de portada dentro de un uniPanel que se encuentra en el MainForm.

     

    Los formulario y frames sucesivos los abro cuando se pulsa alguna opción del mainForm o de otras.

     

    En el post enviado a Dieger he dejado un Link a una de las aplicaciones para que veas como funciona.

     

    ¿ Te importaría dejarme un link a tu aplicación para ver el tiempo de carga ?

     

    Si se te ocurre alguna otra idea que pueda estar haciendo mal, por favor, comentamelá.

     

    Muchisimas gracias.

    Hi,

     

    Keep in mind that UniGUI could easily collapse server's CPU time (several seconds with CPU over 80%). In our case, trying to preload 8 dynamically generated frames with 68 component on each, half of them, labels (544 components in total) causes more than 35 seconds delay, with the usage of server's CPU above than 75% (with several seconds at 100%)...

     

    Regards,

     

     

     

    Hola,

     

    Ten en cuenta que UniGUI podría colapsar fácilmente la CPU del servidor (varios segundos con la CPU a más del 80%). En nuestro caso, una precarga de 8 frames generados dinámicamente con 68 componente en cada uno, la mitad de ellos etiquetas (544 componentes en total) necesita más de 35 segundos, con el uso de la CPU del servidor por encima del 75% (con varios segundos al 100%) ...

     

    Saludos,

×
×
  • Create New...