Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8652391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:17:50+00:00 2026-06-12T14:17:50+00:00

I want to rebind my jqgrid. Here is my script code to bind grid:

  • 0

I want to rebind my jqgrid. Here is my script code to bind grid:

  $(document).ready(function () {

        var categoryId = $('#<%=hdnCategoryId.ClientID %>').val();

        var productName = $('#tags').val();

        jQuery("#tblList").jqGrid({
            url: 'ArenaProductList.aspx/GroupProductList',
            mtype: 'POST',
            datatype: 'json',
            postData: {
                sidx: '',
                sord: '',
                page: '',
                rows: '',
                categoryId: categoryId,
                productName: productName
            },
            ajaxGridOptions: { contentType: "application/json" },
            serializeGridData: function (postData) {
                var propertyName, propertyValue, dataToSend = {};
                for (propertyName in postData) {
                    if (postData.hasOwnProperty(propertyName)) {
                        propertyValue = postData[propertyName];
                        if ($.isFunction(propertyValue)) {
                            dataToSend[propertyName] = propertyValue();
                        } else {
                            dataToSend[propertyName] = propertyValue;
                        }
                    }
                }
                return JSON.stringify(dataToSend);
            },
            jsonReader: {
                root: "d.rows",
                page: "d.page",
                total: "d.total",
                records: "d.records"
            },
            colNames: ['ArenaProductId', 'Açıklama', 'Ana Kategori', 'Alt Kategori', 'Marka', 'KDV', 'Stok', 'Bayi Fiyatı', 'Son Kullanıcı Fiyatı', 'Para Birimi', 'Yüzde'],
            colModel: [
                { name: 'ArenaProductId', index: 'ArenaProductId', hidden: true },
                { name: 'Description1', index: 'Description1', width: 150 },
                { name: 'MainGroupCode', index: 'MainGroupCode', width: 150 },
                { name: 'SubGroupCode', index: 'SubGroupCode', hidden: true },
                { name: 'Brand', index: 'Brand', width: 220 },
                { name: 'Kdv', index: 'Kdv', width: 120 },
                { name: 'Stock', index: 'Stock', width: 100 },
                { name: 'DealerPrice', index: 'DealerPrice', width: 100 },
                { name: 'Price', index: 'Price', width: 100 },
                { name: 'Currency', index: 'Currency', width: 100 },
                { name: 'Rate', index: 'Rate', width: 100 }
            ],
            pager: '#tblPager',
            rowList: [10, 20, 30],
            sortname: 'UserId',
            sortorder: 'desc',
            rowNum: 10,
            loadtext: "Yukleniyor....",
            shrinkToFit: false,
            multiselect: false,
            emptyrecords: "Kayit Bulunamadi",
            autowidth: true,
            shrinkToFit: true,
            height: "400",
            width: "740",
            rownumbers: true,
            //subGrid: true,
            caption: 'Arena Ürünler'
        });
        jQuery("#tblList").jqGrid('navGrid', '#prod_pager',
            { edit: false, add: false, del: false, excel: false, search: false });

        $('#ddlSubCategory').change(function () {
            $('#tags').val('');
            $('#<%=hdnCategoryId.ClientID %>').val($('#<%=ddlSubCategory.ClientID %>').val());
            jQuery("#tblList").trigger('reloadGrid');
        });

        $('#ddlMainCategory').change(function () {
            $('#tags').val('');
            $('#<%=hdnCategoryId.ClientID %>').val($('#<%=ddlMainCategory.ClientID %>').val());
            jQuery("#tblList").trigger('reloadGrid');
        });

    });

And I have a submit button. I want to reload grid with different productName value after I click the button. Do you have any suggestion?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:17:51+00:00Added an answer on June 12, 2026 at 2:17 pm

    If you don’t want to send sidx, sord, page and rows to the server you should use

    prmNames: { page: null, rows: null, sort: null, order: null }
    

    parameter of jqGrid instead of usage

    postData: { sidx: '', sord: '', page: '', rows: '' }
    

    To send categoryId and productName parameter always as the actual values of $('#<%=hdnCategoryId.ClientID %>') and $('#tags').val() you can defines categoryId and productName properties of postData as methods:

    postData: {
        categoryId: function() { return $('#<%=hdnCategoryId.ClientID %>').val(); },
        productName: function() { return $('#tags').val(); }
    }
    

    See the answer for details. You use already the code of serializeGridData which I suggested in the answer. So the serialization of data will work correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the difference between function bind() {$('#content').click(function(){});} and function rebind() {$('#content').click(function(){});} and simple
I am trying to document certain sections of my code using Doxygen. I want
Want to run javascript function from parent window in child window Example I have
Want the function to sort the table by HP but if duplicate HPs then
Want to code a key pad for an calculator. What I want to make
want to rewrite urls like site.com/software to wp-content/themes/dir/software.php and something is not working.. Here's
Is there an existing Linux/POSIX C/C++ library or example code for how to rebind
I have this event binded to my 'body': $('body').bind('keyup', doSomething); But I want to
Can someone please remind me how I do this? I want an MDX query
want to open pdf file when a user clicks on hyperlink shown in gridview

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.