jQWidgets Forums

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Using ASP.NET Core Web API Using ASP.NET Core Web API #89533

    williamjwood76
    Participant

    Thank you for the response. However my problem lies in that I can not get anything but a empty set from adapter.records. I have also tried what is being done in the linked article to no avail. Not sure if this matter but my Web API datasource is cross domain (I have CORS enabled in the Web API project).

    WebAPI method:

            // GET api/changelog
            [HttpGet]
            public JsonResult Get()
            {
                IEnumerable<ApplicationChangeEntryExtension> results = null;
                try
                {
                   results = (from x in db.tblApplicationChangeLogEntries
                              select new ApplicationChangeEntryExtension()
                              {
                                  ID = x.ID,
                                  Application = x.Application,
                                  Version = x.Version,
                                  ReleaseCandidate = x.ReleaseCandidate,
                                  IsReleaseCandidate = x.IsReleaseCandidate,
                                  CustomerContent = x.CustomerContent,
                                  InternalContent = x.InternalContent,
                                  DevDate = x.DevDate,
                                  TestDate = x.TestDate,
                                  PreReleaseDate = x.PreReleaseDate,
                                  PreProductionDate = x.PreProductionDate,
                                  DeployDate = x.DeployDate
                              });
                }
                catch(Exception exc)
                {
                    Console.WriteLine(exc);
                }
                return Json(results);
            }

    Target Site:

    $('#ChangeLogLink').on('click', function (event) {
        $('#popupwindowChangeLog').jqxWindow({
            showCollapseButton: false,
            showCloseButton: true,
            draggable: false,
            isModal: true,
            autoOpen: false,
            height: 500,
            width: 850,
            theme: _Theme,
            modalOpacity: 0,
            initContent: function () {
                var _source = {
                    type: 'GET',
                    datatype: 'json',
                    root: 'results',
                    datafields: [
                        { name: 'ID', type: 'integer' },
                        { name: 'Application', type: 'string' },
                        { name: 'Version', type: 'string' },
                        { name: 'ReleaseCandidate', type: 'integer' },
                        { name: 'IsReleaseCandidate', type: 'boolean' },
                        { name: 'CustomerContent', type: 'string' },
                        { name: 'InternalContent', type: 'string' },
                        { name: 'DevDate', type: 'date' },
                        { name: 'TestDate', type: 'date' },
                        { name: 'PreReleaseDate', type: 'date' },
                        { name: 'PreProductionDate', type: 'date' },
                        { name: 'DeployDate', type: 'date' }
                    ],
                    url: 'http://localhost:2512/api/changelog',
                    id: 'ID'
                };
    
                var _dataAdapter = new $.jqx.dataAdapter(_source);
    
                $("#divChangeLogListContainer").html('<div id="divChangeLogList"></div>');
                $("#divChangeLogList").jqxDataTable({
                    source: _dataAdapter,
                    width: '100%',
                    height: '100%',
                    theme: _integronTheme,
                    pageable: true,
                    pagerButtonsCount: 5,
                    sortable: true,
                    filterable: false,
                    columnsResize: true,
                    pageSize: 25,
                    altRows: true,
                    columns: [
                        { text: 'ID', datafield: 'ID'},
                        { text: 'Application', datafield: 'Application'},
                        { text: 'Version', datafield: 'Version'},
                        { text: 'Release Candidate', datafield: 'ReleaseCandidate'},
                        { text: 'Is Release Candidate', datafield: 'IsReleaseCandidate'},
                        { text: 'Customer Content', datafield: 'CustomerContent'},
                        { text: 'Internal Content', datafield: 'InternalContent'},
                        { text: 'Customer Order #', datafield: 'CustomerOrderID'},
                        { text: 'Dev Date', datafield: 'DevDate', cellsformat: 'M/d/yyyy', cellsalign: 'center', align: 'center'},
                        { text: 'Test Date', datafield: 'TestDate', cellsformat: 'M/d/yyyy', cellsalign: 'center', align: 'center'},
                        { text: 'PreRelease Date', datafield: 'PreReleaseDate', cellsformat: 'M/d/yyyy', cellsalign: 'center', align: 'center'},
                        { text: 'PreProduction Date', datafield: 'PreProductionDate', cellsformat: 'M/d/yyyy', cellsalign: 'center', align: 'center'},
                        { text: 'Deploy Date', datafield: 'DeployDate', cellsformat: 'M/d/yyyy', cellsalign: 'center', align: 'center'}
                    ]
                });
            }
        });
        $('#popupwindowChangeLog').jqxWindow('open');
    
    });
    in reply to: WebAPI integration? WebAPI integration? #89497

    williamjwood76
    Participant

    BenHayat were you able to get this working?

    in reply to: Datatable export problems Datatable export problems #82808

    williamjwood76
    Participant

    Could having serverProcessing: true cause me problems?

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