On my previous post i got some instrunctions how to set this up properly and
finnaly i am getting some list when i start to type inside FilterinSelect
box.
The problem is that all data in list are undefined! :) literally- instead of
members name in the list there is written:
undefined
undefined
undefined
undefined
...
and so on..
Error i got from firebug:
dojox.data.QueryReadStore.getValue(): Item does not have the attribute
'name'.
public function autocompleteAction ()
{
// First, get the model somehow
$model = new AdminWebmasters();
// Then get some request parameters; here we use the GET params
$params = $this->getRequest()->getQuery();
// Fetch results from the model; again, merely illustrative
$results = $model->getAllWebmasters($params);
// Now, create a Zend_Dojo_Data object.
// The first parameter is the name of the field that has a
// unique identifier. The second is the dataset. The third
// should be specified for autocompletion, and should be the
// name of the field representing the data to display in the
// dropdown.
// Assign this to the view
$this->view->data = new Zend_Dojo_Data("id", $results, "username");
}
>From my model:
public function getAllWebmasters ($params)
{
if(isset($params)){
$select = $this->db->select()->from('webmasters', array (
'*'
));
}else{
$select = $this->db->select()->from('webmasters', array (
'*'
))->where('username =?', $params['name']);
}
return $this->db->fetchAll($select);
}
also i have tried this:
public function getAllWebmasters ($params)
{
$select = $this->db->select()->from('webmasters', array (
'*'
));
return $this->db->fetchAll($select);
}
At the end, picture is worth more then tousand words :)
http://www.nabble.com/file/p20937819/dojoError.gif dojoError.gif
Please help me on this, i am so close to have it work :)
Ah, one finall question :)
When i get this Filteringselect works, how i am gonna to display data for
selected member? I want to put it directly inside Zend_Dojo form. You know
what i mean? WHen i choose a member from the list, i would like to have all
their data displayed bellow select field, inside zend dojo form, ready for
editing :)
Thanks,
V
--
View this message in context: http://www.nabble.com/Zend_dojo-autocmplete--i-am-almost-there--need-a-help-about-this-error-tp20937819p20937819.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论