Custom List Div template

FilMar

Member
When I use the div template for al list there is something odd.
I have set an element as rowclass
In the list-template, no problem, each row has the correct class, but not in the div-template
there the first div has the correct class, but the next divs keep also that class and the new class is added (if different)
HTML:
<div class="fabrik_row well row-striped col-md-4 oddRow0 O typeO" id="list_1_com_fabrik_1_row_6">
<div class="fabrik_row well row-striped col-md-4 O typeO oddRow1 S typeS" id="list_1_com_fabrik_1_row_8">
<div class="fabrik_row well row-striped col-md-4 O typeO S typeS oddRow0" id="list_1_com_fabrik_1_row_9">
<div class="fabrik_row well row-striped col-md-4 O typeO S typeS oddRow0 L type L" id="list_1_com_fabrik_1_row_10">
The first div was typeO, the second typeS, the third back typeO and the last typeL, but as you see after the first the other divs get 2 classes or more classes

Also I tried a custom div-template, based on the wiki (http://fabrikar.com/forums/index.php?wiki/creating-a-custom-list-template/) where I used the code for the ajaxify Div template (last example).
It seems good but when I use a filter then some fields get the wrong data
 
Hey FilMar,
What are you trying to achieve with this approach? If this "html box" it's what you've got in your template source code then it seems like you've chosen the longest of possible ways.
Can try to help you but give some more light about your usecase.
 
I was trying to create bootstrap panels with some data in place of a list.
For the list I use an element 'type' as rowclass and there it works fine but if I use the default div template it looks not so good as the rowclass is not properly passed.
First I tought it was because there are 3 columns so 3 divs in a row but even the div in the following row (here line 4) still has also all the previous classes.

As I wanted to have the data in the form of a (bootstrap) panel with some data in the header, some other in the body and also some in the footer of the panel.
I looked for customising the template. Based on the wiki code it seems to go well, just untill I use a filter, then I get the right number of panels but all have the same data.

Greetings,

FilMar
 
I recall an issue with rowclasses and (at least) ajaxfied lists, not sure if this was/is related to the div template or in general.
Is you list ajaxfied?
 
@troester: Yes, it is.

I see now that, when I set Ajaxify to No it seems to work well. But then the page is always reloaded when I apply a filter and the filterbox closed (I did set the filters toggleable)

Greetings,

FilMar
 
FilMar, if you're still looking for solution:

Code:
<div id="<?php echo $this->_row->id;?>" class="fabrik_row_custom col-xl-12 col-lg-12">
    <div id="myDivId1" class="divCell"><?php echo $this->_row->data->yoursFullElement___Name_1;?></div>
    <div id="myDivId2" class="divCell"><?php echo $this->_row->data->yoursFullElement___Name_2;?></div>
         
<div id="customRight" class="divCell">  
    <div id="mySize" class="divCell">
        <div id="myDivId3" class="myCustomClass1"><?php echo $this->_row->data->yoursFullElement___Name_3;?></div>
        <div id="myDivId4" class="myCustomClass2"><?php echo $this->_row->data->yoursFullElement___Name_4;?></div>  
    </div>
        <div id="myActions" class=""><?php echo $this->_row->data->fabrik_actions;?></div>  
        <div id="mySelect" class=""><?php echo $this->_row->data->fabrik_select;?></div>
</div>
</div>

Above has been written in default_row for bootstrap list. I left "customRight" as a sample how you can group some parts of elements - can be useful if you want to keep some data together.
btw. this code isn't within "foreach" function. I did take it off and displays data and amount of rows correctly. Dont know how it will behave with filtering as im not using any within my template but my approach can show you a way of breakdown "table" data in template.
It's a bit manual job with setup but giving lots of freedom.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top