Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Gridfield shows "not items found" on custom table


Go to End


2 Posts   1388 Views

Avatar
PeterR

Community Member, 15 Posts

23 January 2015 at 2:44am

Edited: 23/01/2015 2:47am

Hi all,

I'm trying to use gridfield in front-end template.

When I'm using:

 $gridField = new GridField('test', 'test', SiteTree::get(), $gridFieldConfig); 

it works, but this one

 $gridField = new GridField('test', 'test', My_custom_table::get(), $gridFieldConfig); 

does not work. On the page I can see View 1–9 of 9 , but in table area there is only No items found message

How can I fix it please in order to see my records?

By the way, do you have better documentation to GridField and all it's components?
In this official documentation lacks a lot of explanations.

Avatar
PeterR

Community Member, 15 Posts

25 January 2015 at 7:45am

Finally I found an solution.
The problem was that I did not specify function

public function canView($member = null){
 ... some logic
return true;
}

in class of my custom object (extended from DataObject).