Page 1 of 1

How to create a multi-column list

Posted: Sun May 11, 2014 5:14 am
by prashant purohit

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


How to create a multi-column list

Posted: Sun May 11, 2014 1:38 pm
by Illya Stepanov

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?


How to create a multi-column list

Posted: Sun May 11, 2014 2:30 pm
by prashant purohit

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.


How to create a multi-column list

Posted: Mon May 12, 2014 5:41 pm
by Evgene Karachevtsev

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


How to create a multi-column list

Posted: Wed Jun 04, 2014 5:15 am
by Alex GG

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


How to create a multi-column list

Posted: Wed Jun 04, 2014 10:05 pm
by Alex GG

anything here?


How to create a multi-column list

Posted: Wed Jun 04, 2014 10:37 pm
by Yurii Orishchuk

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


How to create a multi-column list

Posted: Wed Jun 04, 2014 10:37 pm
by Yurii Orishchuk

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