@winz-socialsgmail-com

@winz-socialsgmail-com

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: adding children to expanded row using groupy #104814
    Winston SocialApps
    Participant

    or is this wierd behaviour is because I used Grid as functional component?


    const MyComponent:FC=() => {
    const {datasource} = useGridHooks();
    const {getColumns, onRowExpand} = useGridEvents();

    useEffect(()=>{

    },[])

     

    return (
    <Grid
    columns={getColumns}
    datasource={datasource}
    onRowExpand = {onRowExpand}
    />
    )
    }

    Is this supported approach?

    in reply to: adding children to expanded row using groupy #104812
    Winston SocialApps
    Participant

    Sorry another problem I got, It can add a row using function addRow,
    the problem after multiple rows, the whole expanded rows will collapsed.

    is there any property to set?
    i tried

    ———————-

    currentHRGrid.beginUpdate();
    // add-row
    data.forEach((item:EntitlementsBalance, index:number, items:EntitlementsBalance[])=>{
    const nextRequestType = index > 0 ? (item.requestType === data[index – 1].requestType ? ” : item.requestType) : item.requestType;
    currentHRGrid.addRow({
    id:item.id,
    employeeName: item.employeeName,
    employeeNameForDisplay: item.employeeNameForDisplay,
    requestTypeCode: item.requestTypeCode,
    requestType: nextRequestType,
    year: item.year,
    entitled: item.entitled,
    pending: item.pending,
    used: item.used,
    balanced: item.balanced,
    },true,(row:GridRow)=>{
    console.debug(‘new-row-added:’, row);
    });
    });

    currentHRGrid.endUpdate(true);
    ———————–

    still same behaviour

    also tried putting
    grid.refreshView()

    no luck,

    any possible suggestion?

    in reply to: adding children to expanded row using groupy #104805
    Winston SocialApps
    Participant

    Thanks,
    It works!

    Just a follow-up,
    how to clear the rows previously added or clear the rows before expand?

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