How to disable the button based on Grid rows count using jquery

Posted by kumar on Stack Overflow See other posts from Stack Overflow or by kumar
Published on 2010-06-01T18:33:46Z Indexed on 2010/06/01 20:03 UTC
Read the original article Hit count: 243

Filed under:
|

Hello friends,

I have a button on the view.. I need to make disable based row count in the jquery grid..

that is if Rows are comming lessthen 100 I need to make Disable that button?

any idea about this?

here is my code..

<script type="text/javascript">
    $(document).ready(function() {
        var RegisterGridEvents = function(excGrid) {
            //Register column chooser
            $(excGrid).jqGrid('navButtonAdd', excGrid + '_pager',
                 { caption: "Columns",
                     title: "Reorder Columns",
                     onClickButton: function() {
                         $(excGrid).jqGrid('columnChooser');
                     }
                 });
            $(".ui-pg-selbox").hide();
            $('.ui-jqgrid-htable th:first').prepend('Select All').attr('style', 'font-size:7px');
            //Register grid resize
            $(excGrid).jqGrid('gridResize', { minWidth: 350, maxWidth: 1500, minHeight: 400, maxHeight: 12000 });

        };
        $('#specialist-tab').tabs("option", "disabled", [2, 3, 4]);
        $('.button').button();
        RegisterButtonEvents();
        RegisterGridEvents("#ExceptionsGrid")
    });
        **var a = $("#ExceptionsGrid").jqGrid('getGridParam', 'records').toString();
        alert(a);**
</script>

is this right where I am doing this?

thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jqgrid