I have an editcategory view which shows details about a category and also a table of category descriptions showing at the bottom of the view.
The category description table has two anchor tags for edit and delete. I am using ajax to pass the id of the description to be edited. A function in the controller needs to be called, which calls the categorydescription model and pulls the record based on the id passed. The controller needs to feed the catDescription array back to the ajax success function.
There is already a hidden div that contains the form for editing the description but the values are set as follows
<label for="catlang_name">Name</label>
<input type="text" name="catlang_name" id="catlang_name" class="text ui-widget-content ui-corner-all" value="<?php echo set_value('catlang_name',$catDescription->catlang_name); ?>"/>
My problem is how I can get the response back in Ajax and assign the
For normally passing the data to the view i could have done the following from within the controller
$data['catDescription']=$this->CategoryModel->getCategoryDescriptionById($id)
$this->load->view('category/categoryEdit', $data,true);
This is the data returned from the model :
Array (
[0] => Array (
[catlang_id] => 1
[catlang_cat_id] => 10
[catlang_lang_id] => 2
[catlang_name] => french
[catlang_description] => test
)
[1] => Array (
[catlang_id] => 2
[catlang_cat_id] => 10
[catlang_lang_id] => 2
[catlang_name] => english
[catlang_description] => test
)
)
Any suggestions would be much appreciated.
cheers