7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Input type of sourcefilter/setSourceFilter
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 714 Views |
-
Input type of sourcefilter/setSourceFilter

30 August 2010 at 11:27pm
Hi,
I want to use DataObjectManager as a ResultsTable in ModelAdmin.
This works fine, until I close the popup, then the all the items returns in the TableList without applying my ModelAdmin searchcriteria.
I tried to use $tf->setSoureFilter($filter); , but I need to convert the ResultAssembly from ModelAdmin to a format that DOM can pick up after the refresh.
In the method loadSourceFilter() there is this part:
if(!empty($this->filter)) {
$break = strpos($this->filter, "_");
$field = substr($this->filter, 0, $break);
$value = substr($this->filter, $break+1, strlen($this->filter) - strlen($field));
$filter_string = $field . "='$value'";
}But I don't quite understand what the input needs to be.
The format of the querystring from ModelAdmin is like this:
ResultsForm?Title=test&ResultAssembly%5BTitle%5D=Title
What's the correct input for DataObjectManager->setSourceFilter($filter); so I can convert the ModelAdmin ResultsAssembly to a DataObjectManager format?
Thanks in advance.
| 714 Views | ||
|
Page:
1
|
Go to Top |

