更改 Jquery FlexGrid 的数据

发布于 2024-10-18 12:13:35 字数 4877 浏览 0 评论 0原文

我有一个弹性网格。我需要更改其中显示的数据。

在 $(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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

意犹 2024-10-25 12:13:35

我得到了答案。

我们可以传递选项中的值

  $('#flex1').flexOptions({ url: 'a.apsx'?id=1'
            }).flexReload();

I got the answer.

We can able to pass the value in option

  $('#flex1').flexOptions({ url: 'a.apsx'?id=1'
            }).flexReload();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文