Listgroup BS add image

I´m using the Listgroup BootStrap, ok, easy !

Then, how Do I add a image in each one of the items , and this image is located in a subdirectory img\barcode.png

Thanks in advance

I assume you mean at runtime.

Use the .addItem function. Its first argument is HTML, so you can include an HTML image element.

https://www.w3schools.com/tags/tag_img.asp

George Henne
NS BASIC Corporation
http://www.nsbasic.com

I´m doing this:

cCelula = ‘

Conferir o pedido 999999

lstPedInit.addItem(cCelula)

but it give me a error when I click on the item

you say that if I do this:

cCelula = ‘

Conferir o pedido 999999

Will give the correct effect ?

RICARDO CASSOLATTO

Business Consultant
sintetik@gmail.com / 21 98196-0504

FastMobile
http://fastmobile.info
http://www.facebook.com/ricardo.cassolatto
https://br.linkedin.com/in/ricardo-cassolato-9ba225

Ricardo,

How can anyone help if you don’t say what the error is?

Also, it would help if you identified the code as BASIC or JavaScript.

Asking questions the smart way will get you answers as least twice as quickly:
https://discuss.nsbasic.com/t/how-to-ask-questions-the-smart-way/11/4

this one !

RICARDO CASSOLATTO

Business Consultant
sintetik@gmail.com / 21 98196-0504

FastMobile
http://fastmobile.info
http://www.facebook.com/ricardo.cassolatto
https://br.linkedin.com/in/ricardo-cassolato-9ba225

Can you answer my other question as well?

What is line 1?

Please help us answer you - it’s a waste of everyone’s time if you don’t give the information.

This is the problem, I don´t know whats is line 01 ?

i just want to show a image in each one of the items, the docs says taht it can be a html code, i done it, it´s show the resulkt, but when i click to select a item, give me this error !

The JqWidgets ListBox do this stuff ok, but don´t have a “onselect” or “onclick” event example for how to manage the situation of item selection ! The event only uses a second button to do the selection, I don´t wanna this, I need that if the user select a row , do a stuff !

Thanks in advance for the response

ok !

Ok, sorry for any incovenience !

The question is, step by step:

I used the BootStrap ListBox, and in the docs/wiki says that i can use html code for the each one item in teh list, ok, I done it, and when execute teh app it show ok the html stuff.

But when I click in the item it give me that error, in index.html, line 1 that is exactly, i think, the line one of the .html with the name of my app.

To comparison, I´ve done the same stuff using the jqwidgets listbox, used the same code, but using the renderer of the jqxlistbox, and then, the same result visually, but working fine.

Why I wanna use bs listbox, because it is betteer for the responsive control. Is That

I´ve used this code to listbox bs:

     JavaScript
          cCelula = cCelula + '<table style="text-align: left; width: 268px; height: 40px;"'
          cCelula = cCelula +    'border="1" cellpadding="1" cellspacing="1">'
          cCelula = cCelula +    '<tbody>' 
          cCelula = cCelula +       '<tr> <td style="text-align: center; vertical-align: middle;">'
          cCelula = cCelula +       '<img  style="width: 48px; height: 48px;" alt="" '
          cCelula = cCelula +       'src="img/barcode.png"'
          cCelula = cCelula +       'align="middle"> Conferir o pedido 999999</td>'
          cCelula = cCelula +       '</tr> '  
          cCelula = cCelula + '   </tbody> '
          cCelula = cCelula + '</table>'
          cCelula = '<html><div><img style="width: 48px; height: 48px;" alt="" src="img/barcode.png" align="middle"> Conferir o pedido 999999</div></html>'
       End JavaScript
       
       lstPedInit.addItem(cCelula)

Thank you for the response and patience !

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.