Zend Framework

ZenX JQuery callback function names do not pass down correctly

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.7 Preview Release
  • Fix Version/s: 1.8.0
  • Component/s: Zend_Json, ZendX_JQuery
  • Labels:
    None

Description

I noticed that the callback function names do not pass to the actual JQuery call correctly.

Example:

I have in my View a code like this:

$params = array(
					"resize" => "doMyThingAtResize",
					"title" => "My Zend Dialog",
					);
					
	echo $this->dialogContainer("dialog1", "Some text", $params, array('class' => 'flora'));

It will produce a JQuery call like this:

$("#dialog1").dialog({"resize":"doMyThingAtResize","title":"My Zend Dialog"});

This does work in other ways, but the callback for resize event does not get called as the value is text and not a function name.

What we would need it to produce would be like this:

$("#dialog1").dialog({"resize": doMyThingAtResize,"title":"My Zend Dialog"});

Same thing doMyThingAtResize without the quotes.

Problem goes AFAIK goes to Zend_Json and PHP json_encode as they will wrap the value with quotes, but I don't think this can be solved there.
One solution might be to add a separate function or parameter to add those callback function names. This means some manual code work to merge these into the variables passed to the JQuery call, but I don't see many other options.

Issue Links

Activity

Hide
Benjamin Eberlei added a comment -

Hello,

this is a known issue which will be (hopefully) resolved for the 1.7 release with the Zend_Json_Expr proposal.

Currently you cannot hand down callbacks via Zend_Json.

Show
Benjamin Eberlei added a comment - Hello, this is a known issue which will be (hopefully) resolved for the 1.7 release with the Zend_Json_Expr proposal. Currently you cannot hand down callbacks via Zend_Json.
Hide
Matthew Weier O'Phinney added a comment -

Assigning to Ben Eberlei

Show
Matthew Weier O'Phinney added a comment - Assigning to Ben Eberlei
Hide
Benjamin Eberlei added a comment -

Fixed and scheduled for 1.8

Show
Benjamin Eberlei added a comment - Fixed and scheduled for 1.8

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: