Jump to content

mhmda

uniGUI Subscriber
  • Posts

    1141
  • Joined

  • Last visited

  • Days Won

    157

Posts posted by mhmda

  1. Many times I use custom text in group header, so server side doesn't give much options so I use client side: Ext.XTemplate.

    Example:

    config.groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
       groupHeaderTpl:new Ext.XTemplate('<table class="defaultfont defaultfontsize11"><tr>'+
                       '<td style="font-weight:bold;color:#e62b1e;">'+
                       '{[this.getGroupTitle(values.rows[0])]}</td><td>'+
                       '({[values.children.length]} pax.)</td></tr></table>',
        {
          getGroupTitle: function(values) {                                      
                  return   values.data[3][0];                                    
            }
         })   
      });
      
      config.features= [config.groupingFeature];

     And the the result:

    GR.png

  2. procedure TMainForm.UniButton2Click(Sender: TObject);
    var
     i:Integer;
     json:string;
    begin
     json:='{"Permissions":[';
     for i := 0 to untrvw.Items.Count-1 do
     begin
      if (not untrvw.Items[i].IsLeaf) and (untrvw.Items[i].Level=0) then
      begin
       if json='{"Permissions":[' then
        json:=json+TWebTreeNode(untrvw.Items[i]).ToJSON
       else
        json:=json+','+TWebTreeNode(untrvw.Items[i]).ToJSON;
      end;
     end;
     json:=json+']}';
     UniMemo1.Text:=json;
    end;

     

  3. Well,  it is not as easy as you think,  if the site is static you may use jquery to get values. We use chromium component for delphi to send data and receive data from specific sites.  It all depends on the page you load inside the iframe,  and do not forget the url il loaded in the client side not in the server, for starting inspect the fields that you want to get and use jquery to get their values. 

×
×
  • Create New...