Revision #13 was created by phazei on Jul 28, 2011, 7:20:49 PM.
Added scriptMap to prevent jquery.js from loading and a note about it. Also corrected a bit of grammar.
Content
[...]
The ajaxLink will call an action in the JobController with name ActionAddnew ( we will call it Addnew from now on ), which will either save the job ( after validation ) either rendering the job form.
###3. _FormDialog:
Finally, the job form which consist of a create.php view and a _formDialog.php view, both exist under under job/views/.
The _formDialog.php ( we will call it _formDialog from now on ) will contain an ajaxSubmitButton to submit the Job we want to create.
##Code and details
Now, I don't know from where exactly I should i start to make it more easyeasier for you. I assume you have a little experience with ajaxLink etc al., though iI will try to be as much detailed as iI can.
$this->renderPartial('createDialog',array('model'=>$model,),false,true);
}
}
```~
####Where to pay attention:
I think thisThe scriptMap parameter is essential. Without that line, jquery.js will be loaded again and can cause issues with javascript both already existing on the page, as well as duplicated event handlers for ajax calls run multiple times that contain their own javascript. You may want to use scriptMap to prevent other js files from loading again using '*.js' as the array key.
I think the rest is straightforward. Pay attention the last 2 parameters of [renderPartial](http://www.yiiframework.com/doc/api/CController#renderPartial-detail)
We call first the `createDialog.php` from `job/views/` which is the following.