21487 Posts in 5783 Topics by 2621 members
General Questions
SilverStripe Forums » General Questions » [solved] HasManyComplexTableField > increasing default number of items viewable
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1104 Views |
-
[solved] HasManyComplexTableField > increasing default number of items viewable

21 July 2009 at 11:25am Last edited: 23 July 2009 8:07am
Hi all,
I'm using HasManyComplexTableField to manage 'bookings'.
The default datagrid view (similar to this one: http://tinyurl.com/lsper6) defaults to 'pages' of 10 items each.Is there any way to alter this default amount to, say, 30 items?
Any help / advice appreciated.
Paul
-
Re: [solved] HasManyComplexTableField > increasing default number of items viewable

23 July 2009 at 2:07am
you can do it with the 'setPageSize' method. Here's an example.
$vidField = new HasManyComplexTableField(
$this,
'MyVideos',
'DOVideoFile',
array(
'VideoTitle' => 'Title'
),
'getCMSFields'
);
$vidField->setAddTitle('a Video');$vidField->setPageSize(20);
-
Re: [solved] HasManyComplexTableField > increasing default number of items viewable

23 July 2009 at 8:08am
Thanks Chris,
Ironically I found this this morning by checking properties in complexFieldTable.php and then extending my model in the exact way you suggested.
Works a charm.
Paul -
Re: [solved] HasManyComplexTableField > increasing default number of items viewable

23 July 2009 at 8:09am
You also seem to be able to edit the pageSize property directly eg:
$vidField->pageSize = 20;
Paul
| 1104 Views | ||
|
Page:
1
|
Go to Top |


