Our blazing fast Grid component built with pure JavaScript


Post by notepads »

how to call the ng-click or whatever click function inside the button in the renderer?

    index: 0,
                align: 'center',
                text: 'Manufacture Date',
                field: 'manufactureDate',
                //flex: 1,
                width: '13em',
                editor: false,
                htmlEncode: false,
                type: 'date',
                format: 'DD/MM/YYYY',
                renderer: (data) => `${data.record.manufactureDate == null ? `<button  class="btn btn-warning" style="width:100%;" ng-click="manufacturDateSetClicked()" >` +`SET`+ `</button>` : data.record.manufactureDate}`,
                //hidden: containerGridColumns.deliveryDate,
                filterable: ({ record, value, operator }) => {

                var date1 = new Date(value);
                var date2 = new Date(record.deliveryDate);
                if (operator == '=') {
                    return date1.valueOf() == date2.valueOf();
                } else if (operator == '>') {
                    return date1.valueOf() <= date2.valueOf() && record.deliveryDate != null;
                } else {
                    //when <, less than 
                    return date1.valueOf() >= date2.valueOf() && record.deliveryDate != null;
                }

            },

Post by alex.l »

Hi notepads,

We have special column type to place buttons, please review our example: https://bryntum.com/examples/grid/columntypes/
Shortly, better to use https://bryntum.com/docs/grid/#Grid/column/WidgetColumn and put our https://bryntum.com/docs/grid/#Core/widget/Button component. Also you could try https://bryntum.com/docs/grid/#Grid/column/ActionColumn , it has possibility to hide actions depends on your logic (check example). In this case it's easy to handle click.

All best,
Alex

All the best,
Alex


Post by notepads »

alex.l wrote: Thu Aug 13, 2020 8:09 am

Hi notepads,

We have special column type to place buttons, please review our example: https://bryntum.com/examples/grid/columntypes/
Shortly, better to use https://bryntum.com/docs/grid/#Grid/column/WidgetColumn and put our https://bryntum.com/docs/grid/#Core/widget/Button component. Also you could try https://bryntum.com/docs/grid/#Grid/column/ActionColumn , it has possibility to hide actions depends on your logic (check example). In this case it's easy to handle click.

All best,
Alex

The reason why I am not using your built-in one is because you do not provide 'datetime picker' together. i want to call datetime picker outside the grid so I can update the date time together. But, still do you have any idea to call functions from within the renderer?


Post by mats »

@notepads, as Alex said if you want to have a widget such as a button in a column then please look at the demos / links he provided. It shows you exactly what you need.


Post Reply