jQWidgets Forums

jQuery UI Widgets Forums Grid Foreign Key On Grid

This topic contains 1 reply, has 2 voices, and was last updated by  Todor 5 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Foreign Key On Grid #105056

    Antonio Ruiz
    Participant

    MY CODE:

    public class Historial
    {

    [Key]
    public int ID { get; set; }

    public DateTime Fecha { get; set; }
    public int id_usuario { get; set; }
    public string cambio { get; set; }

    public Oportunidad Oportunidad { get; set; }
    [ForeignKey(“Oportunidad”)]
    public int id_Oportunidad { get; set; }
    }

    MY GRID:

    <jqx-grid id=”gridHistorial” alt-rows=”true” auto-row-height=”true” auto-height=”true” theme=”@ViewData[“Theme”]” sortable=”true” source=”Model.Historial”>
    <jqx-grid-columns>
    <jqx-grid-column datafield=”Fecha” text=”Fecha”></jqx-grid-column>
    <jqx-grid-column datafield=”id_usuario” text=”ID Usuario”></jqx-grid-column>
    <jqx-grid-column datafield=”Descripcion” text=”Descripcion”></jqx-grid-column>
    <jqx-grid-column datafield=”cambio” text=”Cambio”></jqx-grid-column>
    </jqx-grid-columns>
    </jqx-grid>

    JS ERROR WHEN RUNNING THE CODE:

    <jqx-grid><div alt-rows=”True” auto-height=”True” auto-row-height=”True” id=”gridHistorial” sortable=”True” source=”System.Collections.Generic.List`1[CRM.Models.Historial]” theme=””></div>
    <script type=’text/javascript’>$(function () {var source = { dataFields: [ { name: ‘Fecha’, type: ‘date’}, { name: ‘id_usuario’, type: ‘number’}, { name: ‘Descripcion’, type: ”}, { name: ‘cambio’, type: ‘string’}], dataType: ‘array’, localData: [{ ‘ID’: 21, ‘Fecha’: new Date(2019, 4, 6, 17, 0, 25, 953), ‘id_usuario’: 1, ‘cambio’: ‘Cambia estado de \’ILOCALIZABLE\’ a \’NO TRATADO\”, ‘Oportunidad’: , <- HERE’S THE ERROR… #MORE CODE USELESS…#

    IT GETS THE FOREIGN KEY LIKE A FIELD AND LET THE FIELD EMPTY, THROWING ME SYNTAX ERROR…

    How can I solve it?

    Foreign Key On Grid #105070

    Todor
    Participant

    Hello Antonio,

    Could you please try with hard coded source data to check if the error will still exist?

    Best Regards,
    Todor

    jQWidgets Team
    https://www.jqwidgets.com

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

You must be logged in to reply to this topic.