Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #100727
    admin
    Keymaster

    Hi,
    i have write in js file:
    Smart(‘#timeStampGrid’, class {
    get properties() {
    return {
    behavior: {
    columnResizeMode: “split”,
    allowColumnAutoSizeOnDoubleClick: true
    },
    appearance: {
    showRowHeaderNumber: true,
    alternationCount: 2
    },
    paging: {
    enabled: true,
    pageSize: 10,
    pageIndex: 0
    },
    pager: {
    visible: true,
    summary: {
    visible: true,
    position: “far”
    },
    pageSizeSelector: {
    visible: true
    }
    },
    editing: {
    enabled: true,
    mode: ‘row’,
    action: ‘none’,
    dialog: {
    enabled: true
    },
    commandColumn: {
    visible: true,
    position: ‘far’,
    dataSource: {
    commandColumnEdit: {
    visible: true
    },
    commandColumnDelete: {
    visible: false
    },
    commandColumnMenu: {
    visible: true
    },
    commandColumnRowMenu: {
    visible: false
    }
    }
    }
    },
    filtering: {
    enabled: true
    },
    sorting: {
    enabled: true,
    mode: ‘many’
    },
    selection: {
    enabled: true,
    action: ‘click’,
    mode: ‘one’
    },
    locale: ‘it’,
    messages: {
    ‘it’: {
    ‘dialogEditHeader’: “Modifica {{value}}”,
    ‘columnMenuItemSortAsc’: ‘Ascendente {{mode}}’,
    ‘columnMenuItemSortDesc’: ‘Discendente {{mode}}’, //Sort A → Z
    ‘columnMenuItemRemoveSort’: ‘Rimuovi Ordinamento’
    }
    },
    dataSource: new Smart.DataAdapter(
    {
    //                        dataSource: TimeStampLista,
    dataSource: {
    method: ‘POST’
    , url: ‘../../include/TimeStamp_call.php’
    , async: false
    },
    dataSourceType: ‘array’,
    dataFields:
    [
    ‘timeIDTs: number’,
    ‘timeIDAzienda: number’,
    ‘timeIDFunzione: number’,
    ‘timeIDServAs400: number’,
    ‘timeIDLibsAs400: number’,
    ‘timeTs: date’,
    ‘aziDescrizione: string’,
    ‘funzDescrizione: string’,
    ‘servNome: string’,
    ‘libNome: string’
    ]
    }),
    columns: [
    {label: ‘ID’, dataField: ‘timeIDTs’, visible: false, width: 100, align: ‘center’},
    {label: ‘ID Azienda’, dataField: ‘timeIDAzienda’, visible: false, width: 100, align: ‘center’},
    {label: ‘ID Funzione’, dataField: ‘timeIDFunzione’, visible: false, width: 100, align: ‘center’},
    {label: ‘ID Server’, dataField: ‘timeIDServAs400’, visible: false, width: 100, align: ‘center’},
    {label: ‘ID Libreria’, dataField: ‘timeIDLibsAs400’, visible: false, width: 100, align: ‘center’},
    {label: ‘Descrizione’, dataField: ‘funzDescrizione’, width: 300, align: ‘center’},
    {label: ‘Azienda’, dataField: ‘aziDescrizione’, width: 150, align: ‘center’},
    {label: ‘Data e Ora’, dataField: ‘timeTs’, width: 150, align: ‘center’, cellsFormat: ‘dd/MM/yyyy HH:mm:ss’},
    {label: ‘Nome Server’, dataField: ‘servNome’, width: 150, align: ‘center’},
    {label: ‘Nome Libreria’, dataField: ‘libNome’, width: 150, align: ‘center’}
    ]
    };
    }
    });
    but not function.
    Can help me?

    #100728
    Martin
    Member

    Hello Fabio,
    Could you clarify what do you mean that it doesn’t function?
    Is there an issue with rendering the Grid or with binding the data source?
    Thank you!
     
    Best Regards,
    Martin
    Smart HTML Elements Team
    https://www.htmlelements.com

    #100729
    admin
    Keymaster

    Hello Martin,
    I think that the problem is binding the data source because the grid is empty.
    Best regard.

    #100730
    Martin
    Member

    Hello Fabio,
    Currently, Smart.DataAdapter cannot get data from a file.
    So, you can use fetch (or XMLHttpRequest, or jQuery.ajax()) to request the php file’s data and then pass it as an array to the Grid.
    I hope that this answer would be helpful. Feel free to ask if you need further assistance.
     
    Best Regards,
    Martin
    Smart HTML Elements Team
    https://www.htmlelements.com

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.