更改Jquery FlexGrid的数据 [英] Changing Jquery FlexGrid's data

查看:106
本文介绍了更改Jquery FlexGrid的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am having a flex grid. I need to change the data which is showing in that.

在$(document).ready()中,我正在调用一个函数,并且得到了结果.现在我想要的是使用另一个查询从db获取数据.所需的值以获取url中的数据.当我单击按钮时,此函数正在调用.但是请求没有执行.因此,它没有改变.请帮助我.谢谢

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
                    });

        }

推荐答案

我得到了答案.

我们可以在选项中传递值

We can able to pass the value in option

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

这篇关于更改Jquery FlexGrid的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆