Jump to content

TNT23

Members
  • Posts

    28
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by TNT23

  1. Dear sir,

    I am evaluating unigui and i haven't found a way to make unimdbgrid move to next and previous page using a form button. This is important for our company to move on buying unigui . Even if this can't be done UNIGUI is a unique component for delphi developers.

     

  2. I found the answer .... Add the code bellow to CalendarPanel.ExtEvents.eventsrendered

    function eventsrendered(sender, eOpts)
    {           var curView = sender;
                var evtElements = Ext.select('.ext-cal-evt', true);
                if (evtElements)
                {
                    //Loop through all elements
                    Ext.each(evtElements.elements, function(eachEl) {
                        //Get EventId from from elment
                        var evtId = curView.getEventIdFromEl(eachEl);
                        var rec = sender.getEventRecord(evtId);
                        if (!Ext.isEmpty(rec))
                        if (!Ext.isEmpty(evtId)){
                            var pop_content =  "<div id='popup-data'><p><b>Details: </b>" +rec.data.Notes.replace(/\n/g, "<br />")+"</p></div>";
                              new Ext.ToolTip({
                               target: eachEl
                               ,title: rec.data.Title
                               ,dismissDelay: 2000 // auto hide after 2 seconds
                               ,anchor: 'top'
                               ,anchorOffset: 85
                               ,trackMouse: true
                               ,html: pop_content
                              });  
    
               
                        }
                    }, this);
                }
    }
    
    • Upvote 1
  3. I am using the code bellow to display hints when the mouse is over an event... The problem i'm having is that the hint is displayed the second time the mouse goes over the event. I searched the net and i found that the problem is because i create the tooltip inside the eventover .... Is there a workaround???

    function eventover(sender, rec, el, eOpts)
    {
      var pop_content =  "<div id='popup-data'><p><b>Details: </b>" +rec.data.Notes.replace(/\n/g, "<br />")+"</p></div>";
      new Ext.ToolTip({
       target: el
       ,title: rec.data.Title
       ,dismissDelay: 2000 // auto hide after 2 seconds
       ,anchor: 'top'
       ,anchorOffset: 85
       ,trackMouse: true
       ,renderTo: Ext.getBody()
       ,html: pop_content
       }).show;
    }
    
    
    
  4. If anyone wants to resize a grids toolbar (the one with next previous... etc) you can do something like:

     

    servermodule->customcss

     

    Be carefull not to forget !Important because it want work

    .bigicons{
       background-image:url("images/back64.png") !important; 
       width:64px !important;
       height:64px !important;
     }
    

    grid->ExtEvents->OnResize

    function OnResize(sender, adjWidth, adjHeight, rawWidth, rawHeight)
    {
      var tb=sender.getDockedItems('toolbar[dock="bottom"]');;
      if(tb){//if has toolbar
        if (tb.length > 0) tb = tb[0];
        tb.height=74;//resize all the toolbar
        if(tb.items.get(0)){//this is the first item of the toolbar (go to first page)
          tb.items.get(0).height=64;
          tb.items.get(0).width=64;
          //tb.items.get(0).hide(); //you can also hide a button
          tb.items.get(0).setIconCls('bigicons');//this is the css class witch puts the new icon...
        }
      }
    }
    

    I hope this helps someone.... :rolleyes:

    post-466-0-69469500-1377520176_thumb.png

    • Upvote 4
  5. You can use

    ClientEvents->ExtEvents->OnResize

    function window.OnResize(sender, width, height)
    {
       ajaxRequest(sender, 'screensize', ['width='+width,'height='+height] );
    }
    
    

    And do what ever you want in the form implementing OnAjaxEvent of the form

    procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string;
      Params: TStrings);
    begin
      if(EventName='screensize') Then Caption:=Params.Values['width'];
    End;
    
    
    • Like 1
    • Upvote 1
  6. You can to somenthing like this

     

    for I := 0 to UniApplication.UniSession.FormsList.Count-1 do Begin
      if TUniForm(UniApplication.UniSession.FormsList.Items).ClassType<>TMainForm then //TMainForm Is the class of the form that you dont want to close
        TUniForm(UniApplication.UniSession.FormsList.Items).Close;
    End;
     

  7. I found the solution for the database problem and its working like a charm.. :)

    Add the code of the previous post and then just add a dummy value to your query

    eg. : SELECT -1 as id,'' as descr  from dummy union all select id, descr FROM books ;

    You can now search the unidblookupcombobox list values and CLEAR the data, also if value not in list lookup will get previous value ...

     

    • Upvote 1
  8. For those having problems allowing empty value or the selection of only items in list with incremental search in an editable DBLookupComboBox... (i was one too :rolleyes: ) Add to the DBLookupCombobox -> ClientEvents -> ExtEvents -> OnAfterrender 

    function OnAfterrender(sender){ 
    sender.allowBlank=true; 
    sender.editable = true;//This allows you to edit the DBLookupCombobox 
    sender.forceSelection=true;//This line allows only item in list to be selected
    sender.beforeBlur= function(){ 
    var value = this.getRawValue(); 
    if(value == ''){
    this.lastSelection = []; 
    }
     this.doQueryTask.cancel(); 
    this.assertValue(); 
    }
    }
    

    I face a problem on setting null value to the coresponding field at server because the above trick does not set null value to field. I tryed and an ajax request to achieve the update.. but it keeps the last keyfieldvalue of the field.. if anyone can help :(

    • Upvote 4
×
×
  • Create New...