In pivot grid is there a way to capture the entire data that is being passed to the table?

In my scenario i need to get the entire data that is being passed to the pivot grid but by in-build filtering i would have made the pivot table to be displayed with "Failed state only." filters: [{ name: "State", type: "multicombo", value: "Failed"}]

But i need the count for other states too (like pending,completed).So is there any variable that holds the actual entire data within the pivot ?

Thanks

Tagged:

Comments

  • edited June 2018

    Hello,

    Yep, Pivot data holds the full initial dataset, while aggregated (visible) data is stored in the inner datatable. Please check the console: https://snippet.webix.com/8c51wgg1

    Moreover, for each data item from the aggregated set you can get the IDs of source items that were used for it. You can see them in the $source field of each aggregated item.

  • Hi @Helga ,
    When i tired logging subItem ,Am not able to find the $source field in it.
    Point 1:
    //console.log(subItem)

    {str_'HugsGrid: "ficc_raterisk2_hugs_prod, ficc_raterisk2_hugs_prod", str'Exception: "12, 12", str'State: "Failed, Failed", str'StartTime: "22/06/2018 08:01:55 PM, 22/06/2018 08:01:55 PM", str'FinishTime: "22/06/2018 08:05:48 PM, 22/06/2018 08:05:48 PM", …}
    $count:2
    $height:25
    $level:3
    $parent:1530172108637
    id:1530172108638
    name:"TRADING.SFT.AMRS.MARTINI"
    open:true
    str
    'Date:"22/06/2018, 22/06/2018"
    str
    'Exception:"12, 12"
    str
    'FinishTime:"22/06/2018 08:05:48 PM, 22/06/2018 08:05:48 PM"
    str
    'HugsGrid:"ficc_raterisk2_hugs_prod, ficc_raterisk2_hugs_prod"
    str
    'SLATime:"12:45, 12:45"
    str
    'StartTime:"22/06/2018 08:01:55 PM, 22/06/2018 08:01:55 PM"
    str
    'State:"Failed, Failed"
    str
    '_ViewDependency:"11, 11"
    proto:constructor

    Point 2:
    How can i access the origin data in the similar way as the aggregated data being accessed as show below :

    pivot.$$("data").data.eachSubItem(obj.id, function (subItem) {
    if (!subItem.$count){
    childCount++
    if(subItem["str_'_State"] =='Failed')
    failJobCount++;
    }

  • pivot.$$("data").data.eachSubItem - here you already iterate original data.

  • Ya ok Thanks @Helga ... But within pivot.$$("data").data.eachSubItemobj.id, function (subItem) , subItem holds the data visible in the pivot table and we can iterate as shown below.

    columns[i].template = function (obj, common) {
    if (obj.$count)
    // template allows to refer to the table only by ID
    pivot.$$("data").data.eachSubItem(obj.id, function (subItem) {
    let failJobCount = 0;
    if (!subItem.$count){
    childCount++
    if(subItem["str_'_State"] =='Failed')
    failJobCount++;
    }

    How to iterate or fetch the the original data ?

  • @Helga ....The above scenario is possible ? how can i iterate the orginal data ? likewise we are iterating subItem which is displayed data in table. I am not having "$source" field which holds the orginal fields as mentioned above

    Thanks

  • Hi @Helga ,

    https://snippet.webix.com/uuuy5ji6

    FROM THE ABOVE SNIPPET AM ABLE TO PRINT IN CONSOLE THE 1 ST ROW OF THE ORIGINAL DATA THAT IS PASSED TO THE PIVOT TABLE.BUT HOW TO ITERATE IT IN THE SIMILAR WAY AS AGGREGATED DATA WHICH IS BEING ITERATED IN THE ABOVE SNIPPET.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!