I've tried to make this works with this code:
$this->Js->get('#TemplateModel')->event('change',$this->Js->request(
array('action'=>'getColumns'),
array(
'method'=>'post',
'async'=>true,
'update'=>'divSelColumns',
'type'=>'json',
'data'=>$this->Js->serializeForm(array('isForm'=>false))
)
)
);
This script generates this js code:
//<![CDATA[
$(document).ready(function () {$("#TemplateModel").bind("change",
function (event) {$.ajax({async:true,
data:"$(\"#TemplateModel\").closest(\"form\").serialize();",
dataType:"html", success:function (data, textStatus)
{$("divSelColumns").html(data);}, type:"post",
url:"\/diariodeprojetos\/templates\/getColumns"});
return false;});});
//]]>
But take a look at the "data" var, he put the "form serialize" as your
value, when should he passed as literal, he put as string, and doesn't works
in this form.
In my vision, CakePHP still have to mature a lot in this integration with
jQuery.
Thanks and best regards
2011/7/1 Jeferson Rodrigues <[email protected]>
> Hi Jens,
>
> First, tks to reply.
>
> The CakePHP, by default, assign an ID to all inputs in a form, but it's
> hard to make this works.
>
> Well, lets go.... I won't to desist.
>
> Tks and best regards.
>
>
>
> 2011/6/29 Jens Dittrich <[email protected]>
>
>> Why don't you give your select an id so you can select it with $() or
>> ->Js->get().
>> It seems to me that you did not provide an id to the select input so you
>> are probably not really catching what you want with the Js-Helper.
>> If you do not want to give it an id then I think it should be something
>> like $this->Js->get("input#TemplateTable"),
>>
>> regards
>>
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> [email protected] For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php