Jump to content

mhmda

uniGUI Subscriber
  • Posts

    1141
  • Joined

  • Last visited

  • Days Won

    157

Posts posted by mhmda

  1. After fighting long day I found a solution override 'handleDateClick':

    function picker.beforeInit(sender, config)
    {
      config.cls='room_clndr';
      config.DisabledDates=[];
      config.disabledDaysText='חסום';
      config.handleDateClick = function(e, t){
            var me = this,
            handler = me.handler;        
            e.stopEvent();
            if(!me.disabled && t.dateValue){
                me.doCancelFocus = me.focusOnSelect === false;
                me.setValue(new Date(t.dateValue));
                delete me.doCancelFocus;
                me.fireEvent('select', me, me.value);
                if (handler) {
                    handler.call(me.scope || me, me, me.value);
                }
                me.onSelect();
            }
        } 
    }
    

    And:

    function picker.select(sender, date, eOpts)
    {
       if(jQuery.inArray( Ext.Date.format(date, 'd/m/Y'), sender.DisabledDates )>=0) {
          sender.DisabledDates.splice( $.inArray(Ext.Date.format(date, 'd/m/Y'), sender.DisabledDates), 1 );
          if(sender.DisabledDates.length>0) {
           sender.setDisabledDates(sender.DisabledDates);
          }
          else {
           sender.setDisabledDates([null]);
          }        
       }
       else {
        sender.DisabledDates.push(Ext.Date.format(date, 'd/m/Y'));
        sender.setDisabledDates(sender.DisabledDates);    
       } 
    }
    

    CSS:

    .room_clndr .x-datepicker-disabled .x-datepicker-date
    {
     background-color:#fe5757 !important;
     color: #fff !important; 
    }
    

    WORKS PERFECT !!!!  :) 

  2. I want to enable multi select in in UniCalendar:

     

    picker.png

     

    I added this: 

    function picker.beforeInit(sender, config)
    {
      config.cls='room_clndr';//class for background color
      config.DisabledDates=[];//array to hold disabled days
    }
    
    function picker.select(sender, date, eOpts)
    {
       sender.DisabledDates.push(date);
       sender.setDisabledDates(sender.DisabledDates);  
    }
    

    Everything works great except this: if user want to cancel one date from those highlighted (disabled) dates by clicking on it using the mouse, but it disabled because it has -disabled- class, How can I enable the mouse event on those disabled dates, when user click on disabled date I remove it from the array and call:

    sender.setDisabledDates(sender.DisabledDates);
    

    Any idea?

  3. When I use calendar (or when opening calendar example from unigui) I got this in browser console, why?

     

    EXJS Ver. 4.2.5.1763

    UniGUI  0.99.95.1309

    Windows 7 pro

    Delphi Xe8

     

     

     

    cln.png

     

     

    And how can I add 'jumb to'?

     

    cln2.png

     

    And how can I make the week to be default display?

     

    cln3.png

  4. Use field->GetText event:

    procedure TUniMainModule.QryDocinvestigationDoc_TimeGetText(Sender: TField;
      var Text: string; DisplayText: Boolean);
    begin
     Text:=FormatDateTime('dd/MM/yyyy HH:mm',QryDocinvestigation.FieldByName('Doc_Time').AsDateTime);
    end;
    
    • Upvote 1
  5. Hi,

     

    Will I think we should upload a video on youtube showing the correct use of the layout because it is very important for front-end design and there is no documentation on that.

     

    basically you should go through these steps to get the correct result:

     

    1. set AligmentControl = uniAlignmentClient

    2. set Parent (maybe form, panel...) 'layout' to 'vbox','hbox','fit'....

    3. A. keep in mind when using 'vbox' you should set the  'layoutconfing->width'='100%' and for height use flex or just use fix height.

        B. keep in mind when using 'hbox' you should set the  'layoutconfing->height'='100%' and for width use flex or just use fix width.

    4. always draw your design using a paper or any graphic program to get an idea of how you will implement this inside unigui.

     

    good luck :-)

×
×
  • Create New...