Hi,
I have a search option that display first 10 values .I need to display another 10 values on clicking view more option via ajax loading.
.my search functionality is working fine.Only i need to display 'n' values by 10 by 10
controller.php
$con = Yii::app()->db; // Establishing connection to db
try{
$result=$con->createCommand("call searchdetail('$returnResult',".$typevalue.")")->queryAll();
$results=$con->createCommand("call searchCommonUserdetail('$returnResult',".$typevalue.")")->queryAll(); // call for store procedure to execute the query that matches based on user input
}
catch(exception $e){ // handle if any exception arise
}
echo CJSON::encode(array('status' => $results,'statusseg'=> $result));
view.php
for(var i=0 ;i<res.status.length;i++){ //check for lenght of return obj and looping start count
// alert(res.status.length) ;
if(i%2 == 0 ){
alert(i);
divtemp=divcount;
divcount=divcount+1;
$("#search-box2").append(res.status[i].company);
$("#search-box2").append(res.status[i].skills);
$("#search-box2").append(res.status[i].productname);
}
else{$("#search-box1").append(res.status[i].productname);
$("#search-box1").append(res.status[i].name);
$("#search-box1").append(res.status[i].industry);
}
suggest me …