大家好我想在我的下拉列表中从我的数据库中获取所有数据,但现在无论如何我想要它加载所有它只加载前10个数据这是我的代码:
function getProdData(){
notifyClose();
$('#statusContent').show();
$('#preloaderContent').show();
$.ajax({
type : 'GET',
async : false,
data :{
productName : $('#searchBox').val(),
rows: rows,
page: page
},
url : baseUrl+'/admin/getproduct',
error: function(req,error){
notify('e',req.statusText);
},
dataType: 'json',
cache: false,
success : function(msg){
if(Object.keys(msg).length != 0){
$('#discountedProduct option').remove();
var optlst = "";
optlst = "<option value=''>Select Product</option>";
$.each(msg[0].row,function(i,e){
optlst += "<option value='"+e.key+"'>"+e.productName+"</option>"; // in this part i want to put a code that will load all my data from my field in my db.
});
$('#discountedProduct').html(optlst);
}
}
});
$('#statusContent').fadeOut();
$('#preloaderContent').delay(350).fadeOut('slow');
}
有没有办法可以加载其中的所有数据?
修改
public function getproductAction(){
$this->view->disable();
$page = $this->request->get('page');
$rows = $this->request->get('rows');
$productName = $this->request->get('productName');
$productCode = $this->request->get('productCode');
$productPrice = $this->request->get('productPrice');
$productQuantity= $this->request->get('productQuantity');
$url = $this->apiUrl."product/get?q=(page:$page,rows:$rows,productName:$productName,productCode:$productCode,productPrice:$productPrice,productQuantity:$productQuantity)&envelope=false";
$ch = curl_init($url);
curl_setopt_array($ch, $this->curlopt);
echo curl_exec($ch);
}
这是我的管理控制器中的getproduct,但我无法弄清楚那里的限制在哪里。感谢您的帮助:D提前