HTML in ListIconGadget

Just starting out? Need help? Post your questions and find answers here.
Joestes
Posts: 8
Joined: Thu Sep 17, 2015 11:14 am

HTML in ListIconGadget

Post by Joestes »

I've created a small page where people can upload documents to. I use a listicongadget to show the documents in a list. I would like to add a "download" link to the listicongadget. I tried to use "<a href=...> (etc.) but all I see is the text of the html... Is there a workaround to put html code in the columns of a listicongadget? It DOES works for TextGadget...

Code: Select all

dl$ = Chr(34)+"<html><a href='"+#Url+"/Data/"+LoginFilebase+"/Documenten/"+Docu(i)\Filename+"'>Download</a></html>"+Chr(34)
    AddGadgetItem(#lstDocu,-1,Docu(i)\Filename+Chr(10)+FormatDate("%dd-%mm-%yyyy",Docu(i)\Datum)+Chr(10)+Docu(i)\Oms+Chr(10)+Docu(i)+Naam+Chr(10)+dl$)
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: HTML in ListIconGadget

Post by Fred »

I will take a closer look, would be cool if we can get it working as well for listicon items.
Num3
Posts: 22
Joined: Wed Apr 09, 2014 7:09 pm

Re: HTML in ListIconGadget

Post by Num3 »

Any news on this feature?
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: HTML in ListIconGadget

Post by Peter »

You can use the ListIconGadgetEx module: https://github.com/spiderbytes/ListIconGadgetEx

this enables you to render each cell of your ListIconGadget as required. In the example below, I insert the text as HTML in the (TD) cell.

Code: Select all

EnableExplicit

XIncludeFile "ListIconGadgetEx.sbi"

Enumeration
  #Window
  #ListIconGadget
EndEnumeration

Procedure.s RenderCell(Row, Col, Text.s, TD, ListIconGadget)
  
  ! $(v_td).html(v_text);
  
EndProcedure

OpenWindow(#Window, #PB_Ignore, #PB_Ignore, 300, 200, "RenderCell Demo 4", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

ListIconGadget(#ListIconGadget, 10, 10, WindowWidth(#Window) - 20, WindowHeight(#Window) - 20, "Col0", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection | #PB_ListIcon_GridLines)

AddGadgetColumn(#ListIconGadget, 1, "Col1", 100)

AddGadgetItem(#ListIconGadget, -1, "SpiderBasic-Forum" + #LF$ + "<a href='https://forums.spiderbasic.com/' target='_blank'>Click here</a>")

ListIconGadgetEx::RenderCell(#ListIconGadget, 1, @RenderCell()) ; we want to render Column 1
Image
falsam
Posts: 286
Joined: Mon May 05, 2014 9:49 pm
Location: France
Contact:

Re: HTML in ListIconGadget

Post by falsam »

Hello,
Without a ListIconGadget (Yes I'm off topic 🤪), it is possible to create a page containing a list of clickable items.

To do this, I'm using SpiderBasic version 3.01 and its mobile features, which also work with a browser.

Here's the code I'd like you to try out.

Code: Select all

CloseDebugOutput()

If ContainerMobile(#PB_Any, #PB_Mobile_Page, "background-color:lightblue; padding:10px; height:100%; width:100%; font-size:12px;}")
  
  HtmlMobile("<h1>About SpiderBasic</h1> <br>")
  HtmlMobile("<p><a href='https://spiderbasic.com/' target='_blank'><b>SPIDERBASIC</b> <i>A Basic to master the web</a></p")
  HtmlMobile("<p><a href='https://forums.spiderbasic.com/' target='_blank'>Forum</a></p>")
  HtmlMobile("<p><a href='https://www.spiderbasic.com/showcase/onlineviewer/' target='_blank'>Online Viewer</a></p><hr />")
  
  HtmlMobile("<p><a href='https://www.spiderbasic.com/documentation/SpiderBasic.pdf' target='_blank'>SpiderBasic Reference Manual</a></p>")
  
  CloseMobileContainer()
EndIf
Help : https://www.spiderbasic.com/documentati ... index.html

➽ Windows 11 - jdk-11.0.2 - SB 3.00 - Android 15
https://falsam.com

Sorry for my poor english
Post Reply