Can't bind data

hello, good afternoon, I have a question regarding how to link the information between DropDownList and my data, that is, I need to be able to identify the changes that have occurred in the object, in the attached example, I have modified several data and only in the changes has modified the default properties such as 'Subject' while the custom ones do not (i.e 'Cliente', 'Tratamiento', etc). Thank you so much data.PNG


3 Replies 1 reply marked as answer

SP Sureshkumar P Syncfusion Team August 24, 2022 08:00 AM UTC

Hi Ramiro,

Query: I have a question regarding how to link the information between DropDownList and my data

We suggest you use the datasource property you can link your data into our dropdownlist component. To know more about the loading data into the component to refer the below documentation link.

Documentation link: https://ej2.syncfusion.com/angular/documentation/drop-down-list/data-binding/#data-binding

Note: If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.

Regards,

Sureshkumar P




RR ramiro redona August 24, 2022 09:28 PM UTC

Hi Sureshkumar, thanks for answer. 

i 'll detail the error. I have following datasource and eventSettings:

let recurso = {
          Id: this.citas[i].id,
          Subject: this.clientes[i].name,
          StartTime: new Date(anioIni, mesIni, diaIni, horaIni, minutosIni),
          EndTime: new Date(anioFin, mesFin, diaFin, horaFin, minutosFin),
          OwnerId: this.citas[i].id_adm_boxes,
          Tratamiento: this.tratamientos[i].id,
          Estado: this.estados[i].id,
          Cliente: this.clientes[i].id
        }
        recursos.push(recurso)
      }
      this.ownerDataSource = this.boxes
      this.eventSettings = {
        dataSource: recursos,
        fields: {
          id: 'Id',
          subject: { name: 'Subject', title: 'Cliente Anterior' },
          startTime: { name: 'StartTime', title: 'Hora inicio' },
          endTime: { name: 'EndTime', title: 'Hora Fin' },
        }
      };

let dropDownList40: DropDownList = new DropDownList({
            dataSource: data40,
            fields: { text: 'text', value: 'value' },
            value: args.data.Tratamiento,
            floatLabelType: 'Always', placeholder: 'Tratamiento',
            select: this.probando
          });

I think its bind correctly because in DropsDownLists i have options correctly as below (1st screenshot).

The main problem im having its when a edit (chose any option of a list) i don't having the changed property. In the 2nd screenshot i modified some optiong of the list, but in the changed object i don't have it, it shows the old data without modifications. I don't if im expressing well. Thanks again!

data1.png

data2.PNG


PD: only default properties like Subject, StartTime, etc (that are properties own properties of 'fields' in 'EventSettings' took changes well, for example if i changed the Subject to other value for Example 'John' in the changed object i have it well, but i don't know why i can't have modified values from custom 




SP Sureshkumar P Syncfusion Team August 25, 2022 07:45 AM UTC

Hi Ramiro,

We suspect that you have used our dropdownlist component inside any other component like Grid, spreadsheet. And we suspect that your changed column value does not reflect inside the dropdownlist component after editing the values. We suggest you please provide the below details to proceed further on this.

  1. If you have used our dropdownlist component inside any other component, then please share the component details.

  2. If possible, please share the issue replicated sample with us.

  3. If possible, please share your faced exact issue with any image or video demonstration.

  4. If we misunderstood your requirement, then please share your exact requirement with any video or image representation.

These details will help us to provide an exact solution as earlier as possible.

Regards,

Sureshkumar P


Marked as answer
Loader.
Up arrow icon