Jump to content

MultiDetail List with Unigui Mobile?


Fábio Matte

Recommended Posts

  • 2 months later...
On 7/3/2018 at 8:23 AM, Fábio Matte said:
 

 

Is it possible to make a MultiDetail list with Unigui Mobile similar to what we do with the listview dynamicappearance of FMX?

 

 

post-4883-0-11373500-1530624179_thumb.png

 

As I simulate the requirement:
1. I have the html unit that receives text parameters and returns html
2. I add the html to the UnimList

1 ----------------------------------------------------------

// RETORNA CADENA EN FORMATO HTML

unit HTML_COLOR;

interface

uses
   SysUtils ;
var
  w_retorno : boolean;
  function Get_Html(p_string, p_color:string; P_size:integer):string;
//  function Get_Html(P_title; p_valor, p_color:string; P_size:integer):string;


implementation

// http://www.w3schools.com/html/html_colornames.asp
// RED , GREEN, AQUA,  BLACK, BLUE, YELLOW , ORANGE, ORANGERED , MAGENTA..... 

 

//        w_s1:=  HTML_COLOR.Get_Html (ClientDataSet1.FieldByName('NIT').AsString, 'blue', 2) ;
//        w_s2:=  HTML_COLOR.Get_Html (ClientDataSet1.FieldByName('NOMBRE').AsString , 'black', 3) ;
//        w_s3T:= HTML_COLOR.Get_Html ('Direccion:', 'blue', 1) ;


function Get_Html(p_string, p_color:string; P_size:integer):string;
  const
     K_negrita =   '<b> %s </b>' ;
     K_FONT1 = '<font size= "%d" color = " %s" >'  ;
     K_FONT2 = '</font>';
     // <font size="6"> This is some text!</font>
  var
     w_html   :string;
  begin

    // NEGRITA
    if uppercase(p_color) = 'NEGRITAS' then begin
       w_html :=  K_negrita ;
       w_html :=  format(w_html, [ p_STRING]);
       result:=  w_html ;
       exit;
    end;

    // COLORES HTML
    w_html := K_FONT1 ;
    w_html :=  format(w_html, [P_SIZE,  p_color ]);
    result:=  w_html + p_string + K_FONT2 ;
  end;

end.
---------------------------------------

2-----add the html to the UnimList-----------

          // pedidos = DATASET
  while not PEDIDOS.Eof DO begin
    W_STR               := 'Pedido ' + PEDIDOS.FieldByName('NOPEDIDO').AsString ; // + '<br>';
    w_nopedido          := HTML_COLOR.Get_Html ( W_STR, 'BLACK', 2)  ;

    W_STR               := ' Ped.Cliente:' + PEDIDOS.FieldByName('PEDIDOCLIENTE').AsString  + '<br>';
    W_PEDIDOCLIENTE     := HTML_COLOR.Get_Html ( W_STR, 'red', 4)  ;

    W_STR               := 'Despachar A:' + PEDIDOS.FieldByName('CLIENTESHP').AsString   ;
    w_clienteshp        := HTML_COLOR.Get_Html ( W_STR, 'BLACK', 2)  ;

    W_STR               := PEDIDOS.FieldByName('DCLIENTESHP').AsString  ;
    W_DCLIENTESHP       := HTML_COLOR.Get_Html ( W_STR, 'blue', 2)  ;

    UnimList1.Items.Add(W_STR);
    PEDIDOS.Next;
  end;
  PEDIDOS.Close;
 

 

 

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...
  • 4 months later...
  • 1 month later...
×
×
  • Create New...