HI
I have a dropdown field in my frontend and want to load special content via ajax after choosing a Kategorie (category)
Requesting via Ajax works fine... but I dont' know how to bring my valus I get with the DataObject::get() method to my template control snippet,..
that's my sql.. it works fine, (i've tested the sql statement in phpmyadmin. It returns several rows of Typ-Table which I connected to the Kategorie (with the ID 6) via an many_many relationship)
$doSet = DataObject::get(
$callerClass = "Kategorie",
$filter = "Kategorie.ID =6",
$sort="Typ.Bezeichnung ASC",
//$sort = "ORDER BY SortOrder DESC",
$join = "LEFT JOIN Kategorie_Typen ON Kategorie_Typen.KategorieID=Kategorie.ID LEFT JOIN Typ ON Kategorie_Typen.TypID=Typ.ID",
$limit = ""
);
now id like to get that DataObject rendered with my Typ-Template
to use it in its control-tag
<% control Typ %>
$Bezeichnung
<% end_control %>
something like that..:
return $doSet->renderWidth(array('TypTemplate'));
this causes two warnings and returns only the empty template:
1. DataObjectSet::__construct:Passed item #0 is not an object or assoziative array, can't properly iterated on in templates
2. Unknown class passed as parameters
Questions:
How to return my DataObjectSet to my Template and how can I control the data?
Thanks in advance for any advice
Salut
Lukin