Jump to content

Several rows in the tunimdbgrid (mobile) and / or unidbgrid (desktop) for each record


asapltda

Recommended Posts

Hi,

You can use one column of uniDBGrid of Desktop , HTML text and uniDBGird.ForceFit = True to show result of that column

like this in Query SELECT statement : 

SELECT '<H3>' + Produkts."Name" + '</H3>' 
        + '<ul>' + Categories."Name" + '</ul>'
        +  CASE 
            WHEN CONVERT (varchar (250)
                , STUFF (
                        (SELECT CHAR (10) + '|||' + REPLACE (ParamName,'-','') + CHAR (10) + ParamValue
                        FROM Table2
                        WHERE Table2."ID"=Produkts."ID"
                FOR XML Path ('')),1,1,'')) <> ''
            THEN '<h4>' 
                + REPLACE (CONVERT (varchar (250)
                , STUFF (    (SELECT  CHAR (10) + '|||' + REPLACE (ParamName,'-','') + CHAR (10) + ParamValue 
                        FROM Table2
                        WHERE Table2."ID"=Produkts."ID"
                FOR XML Path ('')),1,1,''))
                ,'|||','</br>')
                + '</h4>'

            ELSE ''
            END
        + '<ul><ul><h4 align="right">Цена: '
        + CAST (ROUND (Produkts."Price",2) as varchar (20))
        + ', ' + lower (Produkt."Caption") + '</h4></ul></ul>'

 

OR apply this: 

 

Link to comment
Share on other sites

  • 3 years later...

How can i use code below in DBGrid. When i just copy paste this, it doesn't work.

(this code is used on mobile GridList and works)

 

function beforeInit(sender, config)
{                   

  config.loadingText=false;
  config.grouped=false;
 // config.selectedCls='';
  config.itemTpl='<table style="width:100%;white-space: nowrap;vertical-align:middle;">'+
  
                  '<tr>'+
                       '<td style="color:#0160a9;padding-left:0px;font: bold 18px/24px helvetica, arial, sans-serif" colspan="2">{0}</td>'+
                  '</tr>'+
                  
                  '<tr>'+
                       '<td style="font: 15px helvetica, arial, sans-serif;padding-top:4px;color:#535454;">{1}</td>'+
                  '</tr>'+
                  
                  '<tr>'+
                       '<td style="font: 15px helvetica, arial, sans-serif;padding-top:4px;color:#535454;width:80%;white-space: normal;word-break: break-word;">{2}</td>'+
                  '</tr>'+                                
                                                                    
                  '</table>';

}

 

Link to comment
Share on other sites

3 minutes ago, PS1 said:

How can i use code below in DBGrid(this code is used on mobile GridList and works). When i just copy paste this, it doesn't work.

Hello,

Search the forum using the keyword: XTemplate

Link to comment
Share on other sites

i already searched but i've found only ,,very poorly'' idea in :

 

 

 

and other in which video is not available:

 

 

i guess the second one had good solution, like in mobile ListGrid.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...