Jump to content

Repeater - item collapsed


KaMeKuN
 Share

Recommended Posts

Hi, im trying to play  with the repeaters; i read the excellent tutorial on this page and made some groups for a project but i have a few questions.

  • Is possible to every item for a repeater (item) be collapsed in the panel admin?
  • Is possible change the title for the row, to know his content without need to click then?

Regards.

post-1401-0-56983200-1380639547_thumb.pn

  • Like 1
Link to comment
Share on other sites

You're right apeisa, but soma did come up with a sort of solution.

thanks for your help, this work for me, all my repeater fields start with the word 'repetidor' so i modify the code a little bit to make it work for all my repeaters :D

$('[id^=wrap_Inputfield_repetidor_] ul.Inputfields.ui-sortable > li').addClass("InputfieldStateCollapsed");
 

Now i just need the name, cause i have a lot of item and when i need editing one i need to find one by one..

Regards

Link to comment
Share on other sites

Then there comes Fredi and you can edit them from the front end. ;)

Just to make a little example. If you output those repeater on front-end you simply do:

foreach($page->myrepeater as $rep){
    echo "<div>";
    echo "$page->title: $rep->title<br/>";
    echo $user->isLoggedin() ? $fredi->setText("[edit repeater element]")->renderAll($rep) : "";
    echo "</div>";
}

Make a custom admin page that allows you to edit them. Endless possibilities.

Link to comment
Share on other sites

 <tr>
            <td width="320"> demo test</td>
            <td width="320" class="specMod spect_">• Disponible</td> <!-- repeater 1 item 1 -->
            <td width="320" class="specMod spect_">⊗ No Disponible</td> <!-- repeater 2 item 1 -->
            <td width="320" class="specMod spect_">⊗ No Disponible</td> <!-- repeater 3 item 1 -->
            <td width="320" class="specMod spect_">⊗ No Disponible</td> <!-- repeater 4 item 1 -->
            <td width="320" class="specMod spect_">⊗ No Disponible</td> <!-- repeater 5 item 1 -->
 </tr>
<tr>
 <td width="320"> demo test 2 </td>
 <td width="320" class="specMod spect_">• Disponible</td> <!-- repeater 1 item 2 -->
<td width="320" class="specMod spect_">• Disponible</td> <!-- repeater 2 item 2 -->
....
</tr>

What is the best way in order to do this in PW repeater fields?

Link to comment
Share on other sites

- go to repeaterTable
- download the gist
- install the module

$table = $modules->get("RepeaterTable"); // initialize
$table->thead = false; // (bool) true/false, default = true, will render <th>
$table->indent = 3; // (mixed) false/int, where int is the level of indentation, default: false
$table = $table->render($page->repeater); // repeaterfield called repeater

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...