jQWidgets Forums

jQuery UI Widgets Forums Grid Grid | Get displayed row index

This topic contains 3 replies, has 2 voices, and was last updated by  raj 10 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Grid | Get displayed row index #67004

    raj
    Participant

    Hi,

    I’ve a grid where I’m displaying 10 rows for example. After applying the filter, I need to get the index of the displayed rows & it’s particular column value but instead I’m getting the value of the default loaded bound index and its column value.

    Can anyone suggest me a solution.

    Regards,
    Raj

    Grid | Get displayed row index #67005

    Peter Stoev
    Keymaster

    Hi Raj,

    “getrows” always returns the displayed rows.

    Best Regards,
    Peter Stoev

    Grid | Get displayed row index #67054

    raj
    Participant

    Hi Peter,

    Thanks for your quick turnaround.

    Actually, I need to set cell value to the filtered rows.

    In Detail:
    In my grid I’ve a column defined with columnType:”checkbox” and one parent checkbox at the column header to Check All/ Un-check All.

    Here BEFORE applying filter, Check All/ Un-check All is working fine and AFTER filter it is not working as expected. I achieved the Check All/ Un-check All functionality by getting the rows count and set cell value by passing the index & parent checkbox checked state.

    Following is the piece of code which I’m trying,

    {text: '', datafield: 'linkStatus',columntype: 'checkbox', filterable: false, groupable: false, sortable: false, width: "10%",
    	renderer: function () {
    		return '<div class="checkText" style="text-align:center;line-height:25px"><label>Linked To Domain</label><br /><div id="linkedToDomain" style="left: 50%; margin-left: -10px; top:34px; position:absolute"></div></div>';
    	},
    	rendered: function (element) {
    		var linkStatusChkbox = $(element).find('#linkedToDomain');
    		$(linkStatusChkbox).jqxCheckBox({ theme: theme, width: 16, height: 16, animationShowDelay: 0, animationHideDelay: 0});
    		$(linkStatusChkbox).on('change', function (event) {
    			//Get parent checkbox state
    			var checked = event.args.checked;
    			
    			//Method 1
    			var rowscount = $("#empGrid").jqxGrid('getdatainformation').rowscount;
    			for (var i = 0; i < rowscount; i++) {
    				$("#empGrid").jqxGrid('setcellvalue', i, 'linkStatus', checked);
    			}
    			
    			//Method 2
    			var displayRows = $('#empGrid').jqxGrid('getdisplayrows');
    			for (var i = 0; i < displayRows.length; i++) {
    				var rowData = displayRows[i];
    				$("#empGrid").jqxGrid('setcellvalue', rowData.boundindex, 'accountNumber', checked);
    			}
    		});
    	}
    }

    Both of the above Method 1 & 2 doesn’t give the expected result.

    Please help me, how to set the cell value after filtering based on the current displayed row index.

    Looking for a reply.

    Regards,
    Raj

    Grid | Get displayed row index #67067

    raj
    Participant

    Hi,

    Can somebody help me on this issue? I badly need to get the displayed row index to set cell value after filter.

    Looking for a solution.

    Regards,
    Raj

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

You must be logged in to reply to this topic.