view 20 records, instead of 10
- Single Page
Posted 16 April 2012 - 14:10 PM
Posted 16 April 2012 - 21:54 PM
from this
<option selected="selected" value="10">10 </option>
<option value="25">25 </option>
into this
<option value="10">10 </option>
<option selected="selected" value="20">20 </option>
Posted 19 April 2012 - 12:09 PM
Johnny, in the next version you can add at file grocery_croud.php, config[grocery_crud_default_list_number] ?
Posted 19 April 2012 - 15:28 PM
web-johnny, [color=#333333][font=arial, sans-serif][size=4]I don't know maybe there is more simply and elegant way to do it?[/size][/font][/color]
[color=#333333][font=arial, sans-serif][size=4]But I have to change a bit the core of the grocery_crud:[/size][/font][/color]
[color=#333333][font=arial, sans-serif][size=4]1. near the line #1000 in function "get_list" I had changed lines from[/size][/font][/color]
[color=#333333][font=arial, sans-serif]
[/font][/color]
if($this->config['crud_paging'] === true)
{
if($this->limit == null)
{
$this->basic_model->limit(10);
}
else
{
$this->basic_model->limit($this->limit[0],$this->limit[1]);
}
}
[color=#333333][font=arial, sans-serif][size=4]to[/size][/font][/color]
if($this->config['crud_paging'] === true)
{
if($this->limit == null)
{
$this->basic_model->limit(25);
}
else
{
$this->basic_model->limit($this->limit[0],$this->limit[1]);
}
}
And then in the ./assets/grocery_crud/themes/flexigrid/views/list_template.php file near line #80 I had
<select name="per_page" id='per_page'>
<option selected="selected" value="25">25 </option>
<option value="50">50 </option>
<option value="75">75 </option>
<option value="100">100 </option>
</select>
And near the lines #120-130 I had
<?php $paging_ends_to = "<span id='page-ends-to'>". ($total_results < 25 ? $total_results : 25) ."</span>"; ?>
Posted 20 April 2012 - 04:44 AM
I like the [member='vnt'] idea and I will try to have something like:
$config['grocery_crud_default_per_page'] = 10;
[color=#282828][font=helvetica, arial, sans-serif]to a future version.[/font][/color]
Posted 20 April 2012 - 06:23 AM
I also like vnt's idea. It would be simple and clear. Thanks!
Posted 20 April 2012 - 07:15 AM
Posted 20 April 2012 - 22:55 PM
It is simple you just add the line of code at your config:
// The default per page when a user firstly see a list page
$config['grocery_crud_default_per_page'] = 25; //Can only take values 10,25,50,100
Posted 21 April 2012 - 07:36 AM
Posted 22 April 2012 - 14:47 PM
Posted 05 May 2012 - 06:34 AM
Oh, thanks a lot! Now it doesn't need any more to change the core and it will make easier the process of updating to new vesions of the grocery_CRUD in future.
[/quote][quote name='web-johnny' timestamp='1334897089' post='1349']
Hello guys. I am sorry [member='noskov.biz'] but as you realized the default start paging is hard-coded so this is the only way for now to do it.
I like the [member='vnt'] idea and I will try to have something like:
$config['grocery_crud_default_per_page'] = 10;
[color=#282828][font=helvetica, arial, sans-serif]to a future version.[/font][/color]
[/quote]
How to display all record like 10,25,50,100 and all
Posted 05 May 2012 - 06:35 AM
Hi! Try to change lines #79 and #80 in /your_site/assets/grocery_crud/themes/flexigrid/views/list_template.php
from this
<option selected="selected" value="10">10 </option>
<option value="25">25 </option>
into this
<option value="10">10 </option>
<option selected="selected" value="20">20 </option>
[/quote]
How to display all record in grid like 10,25,50,100 and add one option in list like all
Posted 05 May 2012 - 09:48 AM
Posted 05 May 2012 - 17:11 PM
Posted 05 May 2012 - 19:18 PM