jQuery UI Widgets Forums Grid Load jqxgrid on button click

This topic contains 4 replies, has 3 voices, and was last updated by  harsh 8 years, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Load jqxgrid on button click #72357

    vls
    Participant

    Hello,

    I need to load jqxGrid based on the values selected in a jqxListBox. The scenario is I am selecting the values from jqxListBox and then Click on a button. When the button click event is fired I need to load the jqxGrid. The jqxgrid should be blank with column names on the initial page load.

    Please help me on this.

    Thanks.

    Load jqxgrid on button click #72374

    ivailo
    Participant

    Hi vls,

    Here is the example.

    This article also can be helpful.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Load jqxgrid on button click #72424

    vls
    Participant

    Perfect, This is what exactly I am looking for. Thank you very much.

    Load jqxgrid on button click #76869

    harsh
    Participant

    Hi ,

    I tried the above example and it is not working for me. Here is my code.

    $(“#addselected”).click(function(){
    debugger
    var offtypeid = $(“#offTypeid”).val();
    var rows = $(“#grid1”).jqxGrid(‘getrows’);
    var str = JSON.stringify(rows);
    $.ajax({
    url: “/OfficeTerritory/AddSelected”,
    type: “POST”,
    data: {
    delchkboxloglist: str,
    officeid: officeid,
    offtypeid: offtypeid
    },
    dataType: “json”,
    success: function(data){
    source.localdata = data;
    $(‘#grid’).jqxGrid(‘updatebounddata’);

    }
    });

    public JsonResult AddSelected(string officeid, string offtypeid, string delchkboxloglist)
    {

    List<Location> model = new JavaScriptSerializer().Deserialize<List<Location>>(delchkboxloglist);
    OfficeTypeLocation otl = new OfficeTypeLocation();
    otl.AddOfficeTypeLocation(officeid, offtypeid, model);

    List<OfficeTypeLocation> list = otl.GetOfficeTypeLocation(Convert.ToInt16(offtypeid), Convert.ToInt16(officeid));
    return Json(list, JsonRequestBehavior.AllowGet);

    }

    Load jqxgrid on button click #76870

    harsh
    Participant

    I got it working if i remove this line source.localdata = data;

    thanks,
    harsh

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.