Hi all,
I’m very new in Yii.
I’m building a search box using ESelect2 extention.
When a item is selected, I want to run controller to process selected data.
In view:
<?php
$this->widget('ext.select2.ESelect2',array(
'name'=>'search_job',
'data'=> CHtml::listData(Job::model()->findAll(), 'id', 'name'),
'htmlOptions'=>array(
'id'=>'search_box',
'multiple'=>true,
'placeholder'=>'Tìm kiếm Plan',
'allowClear'=>true,
'class' => 'search-box',
'onclick'=>'job_search()',
),
'options'=>array(
'minimumInputLength'=>1,
),
));
?>
So, what I should do in plan_search() to create url.
// Search box
function job_search(){
var id = document.getElementById('search_box').value;
// What I should to do next ?
}
I looked for other posts, they’re using Ajax, but I dont know about Ajax.
If you have other solution, please help me to solve this.
Thanks in advance.