I think I am a half step further, but stuck on the right methods?
The documentation of the jQuery.ui shows different ways of how to define the "callback" function and the "formatItem" function.
Normally I just have to pass the Option "formatItem:someJSFunction" to define my own function (placed in my view phtml) to style the items like this:
But if I pass this option to my ZendX_JQuery_Form_Element_AutoComplete Object viaCode:function formatItem(row) { return "<span onClick='selectItem("+row[0]+")'>"+ row[0] +" ("+ row[1] +")</span>"; }
nothing happens.Code:->setJQueryParam('formatItem','formatItem')
Also a self coded "onclick" or "select" function is easy with normal jQuery.
It depends on the version you use:
For the ui jquery e.g.:
which seems to be equal to this in ZendX:Code:select:{function(event,ui){ //some action alert(ui.item[0]); }; })
But this also does not work.Code:->setJQueryParam('select','function(event,ui){alert(ui.item[0]);}')
The normal jquery wants to have a .result function as object like this:
I tryed to follow the proxy in ZendX but I cannot find the right methods to implement.Code:$("#users_id").autocomplete("some/path/search.php", { minChars:3, formatItem:formatItem }).result(function(event, item) { selectItem(item[0],item[1],item[2],item[3],item[4]); });
Can someone help?
best regards...


LinkBack URL
About LinkBacks



Reply With Quote
