Premium support for our pure JavaScript UI components


Post by chawkins8584 »

I am having some issues with the multi-group feature. I am currently not using a crudManager in my scheduler and instead am just grouping by my cur_evt_locs from the resourceStore. I have to use the convert function when the data is loaded to convert the string to an array and then subsequently the groups are created from the array. This works great on the first showing of the group, however if i collapse my groups and expand them data starts to disappear. I had to verify this by console logging the resourceStore.getRange() method and it seems that with each collapse and expansion im loosing 1 to 5 records at a time. Im not sure what the issue is. Is the crudManager required for this feature to work or should i be fine just using the resourceStore within the project. I am using SchedulerPro 5.6.1 in case any updates may have come out for this since then.


Post by chawkins8584 »

Here is also an example of my data i am pulling in for my resources

{
            "resource_id": "7",
            "equip_id": "7",
            "equip_num": "02-005",
            "equip_name": "02-005 - CAT - D5K LGP",
            "equip_serial": "D5K750424",
            "equip_type_id": "2",
            "equip_class_name": "Bulldozers - Small",
            "equip_comp_id": "2",
            "equip_loc_id": "10",
            "equip_job_name": "18-017 - N Spring St",
            "equip_is_inventory": "0",
            "equip_is_rental": "0",
            "equip_is_vehicle": "0",
            "equip_is_trailer": "0",
            "equip_div_id": "17",
            "equip_div_name": "Main",
            "equip_forms": null,
            "equip_work_orders": null,
            "equip_specs": null,
            "equip_hours": "759.00",
            "equip_odometer": null,
            "deleted": "0",
            "active": "1",
            "cur_evt_locs": "[\"Not Scheduled\"]"
        },

and here is my convert function im using in the resourceModel

{ 
                name : 'cur_evt_locs', 
                type : 'object', 
                convert : (value, data) => {

                if(typeof value === 'string' && typeof value !== undefined){

                    if(StringHelper.safeJsonParse(value) === null){
                        return value;
                    }
                    return StringHelper.safeJsonParse(value);
                } 

            }
        },

Post by alex.l »

Hi,

Please post full code and data we could use to reproduce the issue, with clear steps to reproduce, actual and expected result. Best of all if you'll apply required changes to one of our demos and share a runnable code.

All the best,
Alex


Post by chawkins8584 »

Hi Alex,

So i made some minor changes to the multi-groups example. when you switch between the groupings make sure to mess around with collapsing the groups and pay attention to the group children and the resourceStore count.

see the attached file and let me know if you have any questions.

Attachments
Multi-Group Example.zip
(258.13 KiB) Downloaded 8 times

Post by chawkins8584 »

So I tested on my code and it looks like records only disappear when some groups are collapsed and others are expanded. If all groups are collapsed no records are removed from the resourceStore when switching between the groups. This is similar behavior to the example I attached. I'm not sure if this has something to do with the StoreGroup group(), or collapse()/expand() methods or the Grid Group collapseAll()/expandAll() or internalToggleCollapse() methods.

It looks like the issue occurs when the real record is collapsed, not when the linked record is collapsed.


Post by ghulam.ghous »

Hi chawkins,

I was able to repro the issue in version 5.6.1 but it is not reproducible in the latest version. I have tried it in 5.6.6 and the issue is not reproducible here. So I recommend you to upgrade to the latest version to get rid of this issue.

Regards,
Ghous


Post by chawkins8584 »

excellent I will upgrade to the latest version and test out the fix. I'll report back shortly if the issue is fixed or if it persists.


Post by ghulam.ghous »

Sure we'll be waiting for your response.


Post by chawkins8584 »

ok this did fix my problem. Thank you for the help!


Post by alex.l »

Hi,

Glad to hear, good luck with your development!

All the best,
Alex


Post Reply