jQuery UI Widgets Forums Grid getSelectedCells in pivotGrid

This topic contains 3 replies, has 2 voices, and was last updated by  Hristo 11 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • getSelectedCells in pivotGrid #102327

    dhsellier
    Participant

    Hi,

    i am facing some issue for getting the the selected cells from a pivotgrid.
    In my development, the selected cells from the pivot gris is used as input for a graph. basically, I try to get all selected cells when I select a pivotItem (.on(‘pivotitemClick’…) and inject the value of selected cells in a graph.

    when i call “pivotCells.getSelectedCells()” I never get any selected cells.

    here my code:

            	$('#divPivotGrid').on('pivotitemclick', function (event) {
            	    var pivotCells = $('#divPivotGrid').jqxPivotGrid('getPivotCells');
            	    var pivotSelectedCells = pivotCells.getSelectedCells();
            	    var pivotRow = pivotSelectedCells[0];
            	    
            	    //here get the header of each selected column
            	    var selectedCellheaderValues = //????
            	    var selectedCellValues = //?????
            	     
               	    var chartInstance = $('#chartContainer').jqxChart('getInstance');
               	 	if(chartInstance == null ) window.alert("empty y values");
               	 	chartInstance.seriesGroups[0].source = selectedCellheaderValues;
               	 	chartInstance.source = selectedCellValues;
                    $('#chartContainer').jqxChart('update');
    
            	});

    thanks for you help
    regards
    DHS

    getSelectedCells in pivotGrid #102334

    Hristo
    Participant

    Hello DHS,

    Please, take a look at this example.
    It demonstrates how to use the getSelectedCells method it is part of the “pivotgridCells”.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    getSelectedCells in pivotGrid #102349

    dhsellier
    Participant

    Hi Hristo,

    many thanks about this example. very helpful.

    It works only when I select cells. if I click on the pivot row I do not have values from the array returned by getSelectedCells(), however all cells are selected including the row header (the first cell of the row).
    could tell me why the array is empty?

    regards

    getSelectedCells in pivotGrid #102393

    Hristo
    Participant

    Hello,

    Thank you for this feedback I will add work item for discussion.
    Meanwhile, you could try to bind to “pivotitemclick” event and then you could recognize when it is clicked on ‘pivotitem’ (columns or rows).
    When this happens you could get the records in this particular column (or row).

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.