prashant purohit
Posts: 0
Joined: Sat Aug 31, 2013 11:00 am

How to create a multi-column list

Hi,
I am trying to capture some form fields and display it as a list. My problem is I can only display one field using this code -
var list = Appery("platformsList");
var newPlatform = Appery("newPlatformField").val();
list.append("a rel="nofollow"" + newPlatform + "/a").listview("refresh");
Appery("newPlatformField").val("");

How can I display the other related fields in a single row.

Expected result in the image -

Image

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

How to create a multi-column list

Hi -

You want to place data from the form to one List component?
Please describe it with more details.

Should it look like the bottom of the image?

prashant purohit
Posts: 0
Joined: Sat Aug 31, 2013 11:00 am

How to create a multi-column list

Thats right.

1) there are three fields in the form: Label 1, Label 2 and Label 3 as shown on top part of image
2) Three inputs needs to be done and press ADD. All 3 values will have to appear in the list below in single row.
3) Everytime ADD is clicked, it adds one row to the list with three values
4) When Add is clicked n times, the list below will have n rows, each with 3 input values.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to create a multi-column list

Hello Prashant,

Try to use thes code for adding list items:code $('[name="mobilelist_2"]')&#46;append(' <li> asdsf</li>');
$('[name="mobilelist_2"]')&#46;listview('refresh'); /code

Alex GG
Posts: 0
Joined: Thu Nov 14, 2013 11:11 pm

How to create a multi-column list

Hi Appery team,

I ́ve a grid element with an image and labels bound to DB ($[]) to generate the list of all rows.

What I need to do is to insert an image every 5 grid elements (this image is a promotional banner), at this time, it only appears at the bottom of the page..

Any suggestion?

Regards

Image

Alex GG
Posts: 0
Joined: Thu Nov 14, 2013 11:11 pm

How to create a multi-column list

anything here?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to create a multi-column list

Hi Alex.

You can inject your images(or other HTML code) with following code:

precode

&#47;&#47;Note "mobilegrid_13" - your grid component name&#46;
var tables = jQuery('[name="mobilegrid_13"]');

var InsertBunner = function(elementAfter){
var image = jQuery('<img class="injectedImage" src="http:&#47;&#47;t2&#46;gstatic&#46;com/images?q=tbn:ANd9GcSDk5HyUR0Y7Cn5SMR5LJHYLcGO_QNvqJyX5So_mGa76M_xMuixcA"/>');

Code: Select all

 image&#46;insertAfter(elementAfter); 

};

for(var i = 0; i < tables&#46;length; i++){
var table = jQuery(tables);

Code: Select all

 if(i % 5 == 4) 
     &#47;&#47;console&#46;log(i); 
     InsertBunner(table); 

};

/code/pre

Regards

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to create a multi-column list

Hi Alex.

You can inject your images(or other HTML code) with following code:

precode

&#47;&#47;Note "mobilegrid_13" - your grid component name&#46;
var tables = jQuery('[name="mobilegrid_13"]');

var InsertBunner = function(elementAfter){
var image = jQuery('<img class="injectedImage" src="http:&#47;&#47;t2&#46;gstatic&#46;com/images?q=tbn:ANd9GcSDk5HyUR0Y7Cn5SMR5LJHYLcGO_QNvqJyX5So_mGa76M_xMuixcA"/>');

Code: Select all

 image&#46;insertAfter(elementAfter); 

};

for(var i = 0; i < tables&#46;length; i++){
var table = jQuery(tables);

Code: Select all

 if(i % 5 == 4) 
     &#47;&#47;console&#46;log(i); 
     InsertBunner(table); 

};

/code/pre

Regards

Return to “Issues”