Our pure JavaScript Scheduler component


Post by boyitech »

Greetings!

Now I'm using predecessors tab in taskedit but I can't get predecessors data from eventRecord in function named 'afterTaskEdit' or 'afterEventSave'.

Image


Post by tasnim »

Hello,

I tried the latest release to reproduce the issue here https://bryntum.com/products/schedulerpro/examples/constraints/
But it seems to be working fine.
What version are you using? Could you upload a test case here so we can debug it?


Post by boyitech »

I'm using the version 5.2.0. Whether it's a version issue? Should I upgrade my version to the latest?


Post by tasnim »

I also tested in version 5.2.0
But it also works fine there

Maybe the problem is with your code. Could you please upload a runnable test case here so we can debug it?


Post by boyitech »

Hers's the taskEdit code

taskEdit: {
        editorConfig: {
          title: 'Task Edit',
          bbar: {
            items: {
              deleteButton: false,
              // saveButton: true,
            },
          },
        },
        items: {
          generalTab: {
            items: {
              nameField: {
                type: 'text',
                name: 'name',
                label: 'Name',
                weight: 100,
                readOnly: true,
              },
              requirementField: {
                type: 'text',
                name: 'requirement',
                label: 'Requirement',
                weight: 100,
                flex: '1 0 50%',
                readOnly: true,
              },
              qtyNumField: {
                type: 'number',
                name: 'qtyNum',
                label: 'Qty No.',
                flex: '1 0 50%',
                weight: 100,
                readOnly: true,
                required: true,
                min: 1,
              },
              locationField: {
                type: 'combo',
                name: 'location',
                label: 'Location',
                weight: 100,
                flex: '1 0 50%',
                items: [],
                readOnly: true,
              },
              resultField: {
                type: 'combo',
                name: 'result',
                label: 'Result',
                weight: 100,
                flex: '1 0 50%',
                items: [],
                readOnly: true,
              },
              equipTypeField: {
                type: 'combo',
                name: 'equipType',
                label: 'Equipment Type',
                weight: 100,
                flex: '1 0 50%',
                items: [],
                readOnly: true,
                listeners: {
                  thisObj: this,
                  },
              },
              equipspecialField: {
                type: 'combo',
                name: 'equipSpecialType',
                label: 'Type.Test Bench',
                multiSelect: true,
                weight: 100,
                flex: '1 0 50%',
                items: [],
                value: [],
                readOnly: true,
              },
              startdateField: {
                type: 'dateField',
                name: 'startDate',
                label: 'Choose startDate',
                weight: 100,
                flex: '1 0 50%',
                readOnly: true,
              },
              enddateField: {
                type: 'dateField',
                name: 'endDate',
                label: 'Choose endDate',
                weight: 100,
                flex: '1 0 50%',
                readOnly: true,
              },
              duedateField: {
                type: 'dateField',
                name: 'duedate',
                label: 'Sample Avalilable Date',
                weight: 100,
                flex: '1 0 50%',
                readOnly: true,
              },
              testbenchField: {
                type: 'text',
                name: 'equipInfoName',
                label: 'Test Bench',
                weight: 100,
                flex: '1 0 50%',
                readOnly: true,
              },
              percentDoneField: {
                disabled: true,
                readOnly: true,
                // weight: 100,
                // flex: '1 0 50%',
              },

          colorField: {
            type: 'combo',
            name: 'color',
            label: 'Color',
            weight: 100,
            flex: '1 0 50%',
            items: Scheduler.eventColors,
            listItemTpl: item => `<div class="color-box b-sch-${item.value}">&emsp;</div><div>${item.value}</div>`,
            listeners: {
              thisObj: this,
              change(event) {
                if (event.value) {
                  const editor = event.source.owner;
                }
              },
            },

          },
          startDateField: false,
          endDateField: false,
          resourcesField: false,
          durationField: false,
        },
      },
      notesTab: false,
      // predecessorsTab: false,
      // successorsTab: false,
      advancedTab: false,
      
    },
  },

When I set successors or predecessors, I can only find successors data from the first task but no predecessors from another. The predecessors data from the second task only shows when I use add button.

Image
Image
Image


Post by tasnim »

Hi,

I'm still not able to reproduce it. Could you please try upgrading to 5.3.0, if it is reproducible in there or not?


Post by boyitech »

You can just add the following tab in task edit and let the samleList's data = [] . When the data is assigned,the predecessors tab can't show the value.

newTab: {
            title: 'Samples List',
            weight: 100,
            items: {
              grid: {
                type: 'grid',
                height: 300,
                columns: [
                  { text: 'Sample No', field: 'sampleNo' },
                  { text: 'Part No', field: 'partNo' },
                  { text: 'Series No', field: 'seriesNo' },
                  {
                    text: 'To Test Step',
                    type: 'widget',
                    widgets: [
                      {
                        type: 'button',
                        text: 'Link',
                        flex: 1,
                        icon: 'b-fa b-fa-link',
                        // cls: 'b-blue b-raised',
                        onAction: ({ source: btn }) => {
                          this.router.navigate([
                            'app/samples/samples',
                            {
                              sampleId: btn.cellInfo.record.id,
                              formUrl: 'app/resource-arrangement/resource/' + this.currentResourceTypeId,
                            },
                          ]);
                        },
                      },
                    ],
                  },
                ],
                data: [],
              },
            },
          },
beforeTaskEditShow(e) { const sampleList = e.editor.widgetMap.grid;
        sampleList.data = [];}

Image


Post by tasnim »

Hi,

The way you're getting sampleList grid, it's not the grid of sampleList

You should get it like this

    listeners : {
        beforeTaskEditShow(e) {
            const sampleList = e.editor.widgetMap.newTab.widgetMap.grid;
            sampleList.data = [];
        }
    }

This should be working for you.


Post Reply