Our pure JavaScript Scheduler component


Post by JohnMousley »

Hi, I need to be able to populate a list on a TaskEdit tab using the store.

I have set it up but the data from the store is not showing, see setup below:

Data setup, although this will come from a web service eventually.

var oScoresList = [];
var oScore = {};

oScore = {};
oScore.id = 123456;
oScore.text = "Bran Freemont";
oScoresList.push(oScore);

oScore = {};
oScore.id = 3322321;
oScore.text = "Thomson Crackmore";
oScoresList.push(oScore);

oScore = {};
oScore.id = 9371564;
oScore.text = "Sarah Freshman";
oScoresList.push(oScore);

The List setup in the task edit:

            taskEdit: {
                showDeleteButton: false,
                editorConfig: {
                    title: 'My title'
                },
                items: {
                    customerTab: null,
                    oppTab: null,
                    notesTab: null,
                    scoresTab: {
                        title: 'My Scores',
                        weight: 20,
                        items: {
                            scoresList: {
                                type: 'List',
                                store: oScoresList,
                                displayField: 'text',
                                textField: 'text',                            
} } }, predecessorsTab: false, successorsTab: false, advancedTab: false } }

I have attached the sample code, to re-create.

  1. Double click an event.
  2. The "MY Scores" tab is empty.

Thanks
Brian.

Attachments
ScheduleWS.zip
(29.64 KiB) Downloaded 41 times

Post by alex.l »

I don't even see a taskEditor. Simply you need to use items config or correct store notation.

Please check docs:
https://bryntum.com/docs/gantt/api/Core/widget/Combo#config-items
https://bryntum.com/docs/gantt/api/Core/widget/Combo#config-store

items: {
                    scoresTab: {
                        title: 'My Scores',
                        weight: 20,
                        items: {
                            scoresList: {
                                type: 'List',
                                items: oScoresList, // <---- here
                                displayField: 'text',
                                textField: 'text',                            
}

All the best,
Alex


Post by JohnMousley »

Hi, that worked thanks.

Is it possible to show headers on a list? if not, what control would allow multiple columns and headers?

Thanks
Brian.


Post by alex.l »

Could you please describe in more details how do you want it should look like? Wouldn't the https://bryntum.com/docs/scheduler/api/Core/widget/Combo#config-listItemTpl be enough for your goals?
Or maybe https://bryntum.com/docs/scheduler/api/Core/widget/Combo#snippet-grouped-list

All the best,
Alex


Post by JohnMousley »

Hi, I've changed to using a grid to display my data in a task edit tab.

I now need to capture the double click event on the grid that is showing, then I can use the information for that record to perform additional actions.

I have found the event I want to use but cannot find an example of it being implemented
https://bryntum.com/docs/gantt/api/Grid/view/mixin/GridElementEvents#event-cellDblClick:

Can you point me in the right direction on how to achieve this?

Thanks


Post by JohnMousley »

I have managed to find the answer, I added the listeners to the grid control and then added the event, see code below:

           taskEdit: {
                showDeleteButton: false,
                editorConfig: {
                    title: 'My title'
                },
                items: {
                    customerTab: null,
                    oppTab: null,
                    notesTab: null,
                    scoresTab: {
                        title: 'My Scores',
                        weight: 20,
                        items: {
                            scoresList: {
                                type: 'Grid',
                                features: {
                                    cellEdit: false                                   
}, columns: [ { field: 'value', text: 'value Title' }, { field: 'name', text: 'Name Title'} ],
data: oScoresRoot.oScoresList, // <---- here
width: 200, listeners: { cellDblClick({grid,record,column,cellElement,target,event}){ if (record){ } } } } } }, predecessorsTab: false, successorsTab: false, advancedTab: false } }

Thanks for your assistance, still getting used to all that the control can do.

Regards
Brian.


Post Reply