更改 Jquery FlexGrid 的数据
我有一个弹性网格。我需要更改其中显示的数据。
在 $(document).ready() 中,我正在调用一个函数并得到结果。现在我想要的是使用另一个查询从数据库获取数据。所以我只是创建了一个函数,因为我正在添加所需的值获取网址中的数据。当我单击按钮时,该函数正在调用。但是请求没有进行。所以这没有改变。请帮助我。谢谢
$(document).ready(function() {
getAllData(); //first call
$(".datebetweenList").click(function() {
getDataBetweenDates(); //secondcall change in url
});
});
// Calls First
function getAllData() {
$("#flex1").flexigrid
({
url: '../Handlers/AjaxGetData.ashx?isFlexi=<%=Request.QueryString["ass"]%>&bid=' + document.getElementById("<%=ddlBranch.ClientID%>").value,
dataType: "json",
colModel: [
{ display: 'Sl No', name: 'SlNo', width: 10, hide: true, sortable: false, align: 'center' },
{ display: 'Sl No', name: 'SlNo', width: 60, sortable: false, align: 'center' },
{ display: 'Code', name: 'asset_Code', width: 180, sortable: true, align: 'left' },
{ display: 'Name', name: 'asset_Name', width: 150, sortable: true, align: 'left' },
{ display: 'Serial No', name: 'asset_Sl_No', width: 150, sortable: true, align: 'left' },
{ display: 'Category', name: 'asset_Category', width: 150, sortable: true, align: 'left' },
{ display: 'Location', name: 'location_Name', width: 150, sortable: true, align: 'left' },
{ display: 'Qty', name: 'qty', width: 150, sortable: true, align: 'left' },
{ display: 'Status', name: 'status', width: 150, sortable: true, align: 'left' },
{ display: 'Report', name: 'Report', width: 150, sortable: false, align: 'left' }
],
buttons: [
],
searchitems: [
{ display: 'Asset Name', name: 'asset_Name' }
],
sortname: "asset_Name",
sortorder: "asc",
usepager: true,
singleSelect: true,
title: "Asset Stock Report",
useRp: true,
rp: 15,
showTableToggleBtn: true,
width: 1240,
height: 200
});
}
//Calls Second [on clicking a button]
function getDataBetweenDates() {
$("#flex1").flexigrid
({
url: '../Handlers/AjaxGetData.ashx?isFlexi=<%=Request.QueryString["ass"]%>&bid='
+ document.getElementById("<%=ddlBranch.ClientID%>").value + '&isDate=1&eDate=' +
document.getElementById("<%=txtEndDate.ClientID%>").value +
'&sDate=' + document.getElementById("<%=txtStartDate.ClientID%>").value,
dataType: "json",
colModel: [
{ display: 'Sl No', name: 'SlNo', width: 10, hide: true, sortable: false, align: 'center' },
{ display: 'Sl No', name: 'SlNo', width: 60, sortable: false, align: 'center' },
{ display: 'Code', name: 'asset_Code', width: 180, sortable: true, align: 'left' },
{ display: 'Name', name: 'asset_Name', width: 150, sortable: true, align: 'left' },
{ display: 'Serial No', name: 'asset_Sl_No', width: 150, sortable: true, align: 'left' },
{ display: 'Category', name: 'asset_Category', width: 150, sortable: true, align: 'left' },
{ display: 'Location', name: 'location_Name', width: 150, sortable: true, align: 'left' },
{ display: 'Qty', name: 'qty', width: 150, sortable: true, align: 'left' },
{ display: 'Status', name: 'status', width: 150, sortable: true, align: 'left' },
{ display: 'Report', name: 'Report', width: 150, sortable: false, align: 'left' }
],
buttons: [
],
searchitems: [
{ display: 'Asset Name', name: 'asset_Name' }
],
sortname: "asset_Name",
sortorder: "asc",
usepager: true,
singleSelect: true,
title: "Asset Stock Report",
useRp: true,
rp: 15,
showTableToggleBtn: true,
width: 1240,
height: 200
});
}
I am having a flex grid. I need to change the data which is showing in that.
In $(document).ready() I am calling a function and I am getting the result.Now what i want is to get data from db using another query.So I just made a function, in that i am adding the needed values to fetch the data in the url.This function is calling when I click a button .But the request is not going .So that is not changing.Please Help me. Thanks
$(document).ready(function() {
getAllData(); //first call
$(".datebetweenList").click(function() {
getDataBetweenDates(); //secondcall change in url
});
});
// Calls First
function getAllData() {
$("#flex1").flexigrid
({
url: '../Handlers/AjaxGetData.ashx?isFlexi=<%=Request.QueryString["ass"]%>&bid=' + document.getElementById("<%=ddlBranch.ClientID%>").value,
dataType: "json",
colModel: [
{ display: 'Sl No', name: 'SlNo', width: 10, hide: true, sortable: false, align: 'center' },
{ display: 'Sl No', name: 'SlNo', width: 60, sortable: false, align: 'center' },
{ display: 'Code', name: 'asset_Code', width: 180, sortable: true, align: 'left' },
{ display: 'Name', name: 'asset_Name', width: 150, sortable: true, align: 'left' },
{ display: 'Serial No', name: 'asset_Sl_No', width: 150, sortable: true, align: 'left' },
{ display: 'Category', name: 'asset_Category', width: 150, sortable: true, align: 'left' },
{ display: 'Location', name: 'location_Name', width: 150, sortable: true, align: 'left' },
{ display: 'Qty', name: 'qty', width: 150, sortable: true, align: 'left' },
{ display: 'Status', name: 'status', width: 150, sortable: true, align: 'left' },
{ display: 'Report', name: 'Report', width: 150, sortable: false, align: 'left' }
],
buttons: [
],
searchitems: [
{ display: 'Asset Name', name: 'asset_Name' }
],
sortname: "asset_Name",
sortorder: "asc",
usepager: true,
singleSelect: true,
title: "Asset Stock Report",
useRp: true,
rp: 15,
showTableToggleBtn: true,
width: 1240,
height: 200
});
}
//Calls Second [on clicking a button]
function getDataBetweenDates() {
$("#flex1").flexigrid
({
url: '../Handlers/AjaxGetData.ashx?isFlexi=<%=Request.QueryString["ass"]%>&bid='
+ document.getElementById("<%=ddlBranch.ClientID%>").value + '&isDate=1&eDate=' +
document.getElementById("<%=txtEndDate.ClientID%>").value +
'&sDate=' + document.getElementById("<%=txtStartDate.ClientID%>").value,
dataType: "json",
colModel: [
{ display: 'Sl No', name: 'SlNo', width: 10, hide: true, sortable: false, align: 'center' },
{ display: 'Sl No', name: 'SlNo', width: 60, sortable: false, align: 'center' },
{ display: 'Code', name: 'asset_Code', width: 180, sortable: true, align: 'left' },
{ display: 'Name', name: 'asset_Name', width: 150, sortable: true, align: 'left' },
{ display: 'Serial No', name: 'asset_Sl_No', width: 150, sortable: true, align: 'left' },
{ display: 'Category', name: 'asset_Category', width: 150, sortable: true, align: 'left' },
{ display: 'Location', name: 'location_Name', width: 150, sortable: true, align: 'left' },
{ display: 'Qty', name: 'qty', width: 150, sortable: true, align: 'left' },
{ display: 'Status', name: 'status', width: 150, sortable: true, align: 'left' },
{ display: 'Report', name: 'Report', width: 150, sortable: false, align: 'left' }
],
buttons: [
],
searchitems: [
{ display: 'Asset Name', name: 'asset_Name' }
],
sortname: "asset_Name",
sortorder: "asc",
usepager: true,
singleSelect: true,
title: "Asset Stock Report",
useRp: true,
rp: 15,
showTableToggleBtn: true,
width: 1240,
height: 200
});
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我得到了答案。
我们可以传递选项中的值
I got the answer.
We can able to pass the value in option