Forum Replies Created

Viewing 15 posts - 16 through 30 (of 58 total)
  • Author
    Posts

  • sdalby
    Member

    Hi Peter

    Yes the page

    http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-extra-http-variables.htm

    adresses this issue and comes up with a solution for $.ajax calls, but none that I can utilize for the datasource. It still translates into a text/hml call which makes ASMX services return XML rather than JSON.

    I have however managed to make it work a ASP.NET Generic handler and while this is far from an elegant solution it works, and I have been stuck with this for a week now, so I will let it be for now.

    Thanks for your assistance.

    Soeren


    sdalby
    Member

    I think that I have found out why there is a problem here and it appears as if you have a bug in your way of accessing WebServices

    It is explained here:

    http://encosia.com/asmx-scriptservice-mistake-invalid-json-primitive/

    basically, it explains why use of parameters causes contentType to be changed to

    application/x-www-form-urlencoded

    which in turn causes ASMX Web Services to malfunction.

    It also explains how to fix it.

    The fix is to use ‘data’ to assign parameters rather than using url’ values. Can I overwrite your default behaviour in order to do this?

    • This reply was modified 11 years, 5 months ago by  sdalby.

    sdalby
    Member

    Hi

    I started with that example but in order to follow your instructions, I have changed it back.

    I think that I found out what the cause is but dont know how to fix it. Your code make a response with the form:

    GET /Cob/EodOverviewWebService.asmx/GetOverviewLines?pagenum=0&pagesize=10 HTTP/1.1

    And this causes the error:

    Request format is unrecognized for URL unexpectedly ending in '/GetOverviewLines'.

    I think it is the combination of an URL that identifies a method and using get parameters, but since your code stresses that one should use GET and not POSTS, I am a bit lost.

    As mentioned earlier I cannot figure out how to install an errorhandler to this datasource request.

    Here is the new code:

        source = {
    url: 'EodOverviewWebService.asmx/GetOverviewLines',
    contentType: 'application/json; charset=utf-8',
    datatype: "json",
    datafields: [
    { name: 'Id' },
    { name: 'TimeToFire' },
    { name: 'SysDate' },
    { name: 'NewDate' },
    { name: 'Status' },
    { name: 'ReasonForExecution' },
    { name: 'ModulesExecuted' }
    ],
    async: false,
    formatdata: function (data) {
    return { pagenum: data.pagenum, pagesize: data.pagesize };
    }
    };
    $.ajax({
    url: 'EodOverviewWebService.asmx/GetOverviewCount',
    contentType: 'application/json; charset=utf-8',
    async: false,
    error: errorHandler,
    success: function (data) {
    source.totalrecords = data.d;
    }
    });
    var dataadapter = new $.jqx.dataAdapter(source);
    $("#jqxOverviewGrid").jqxGrid(
    {
    width: 600,
    source: dataadapter,
    theme: theme,
    autoheight: true,
    pageable: true,
    virtualmode: true,
    rendergridrows: function () {
    return dataadapter.records;
    },
    columns: [
    { text: 'Task id', datafield: 'Id', width: 250 },
    { text: 'Execution date', datafield: 'TimeToFire', width: 200 },
    { text: 'System date', datafield: 'SysDate', width: 200 },
    { text: 'New date', datafield: 'NewDate', width: 180 },
    { text: 'Modules executed', datafield: 'ModulesExecuted', width: 100 },
    { text: 'Reason for execution', datafield: 'ReasonForExecution', width: 140 },
    { text: 'Status', datafield: 'Status', width: 140 }
    ]
    });

    and server side:

            [WebMethod(EnableSession = true)]
    [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
    public List<EodRow> GetOverviewLines(int pagenum, int pagesize)
    {
    int skip = pagenum*pagesize;
    int take = pagesize;
    string environment = ((TaskEnvironment) HttpContext.Current.Session[WebConstants.SessionTaskEnvironment]).EnvironmentName;
    List<EodDao.EodStatusAndTask> eodStatusAndTaskListForEnvironment = EodDao.GetEodStatusAndTaskListForEnvironment(environment, skip, take);
    List<EodRow> eodRowList = new List<EodRow>();
    foreach (EodDao.EodStatusAndTask eodStatusAndTask in eodStatusAndTaskListForEnvironment)
    {
    EodRow eodRow = null;
    if (eodStatusAndTask.EodStatus != null)
    {
    bool anyErrors = EodDao.HasErrors(eodStatusAndTask.EodStatus.Id);
    eodRow = new EodRow(eodStatusAndTask.Task.Id,
    eodStatusAndTask.Task.TimeToFire,
    eodStatusAndTask.EodStatus.SysDate,
    eodStatusAndTask.EodStatus.NewDate,
    eodStatusAndTask.Task.StatusEnum,
    eodStatusAndTask.EodStatus.ReasonForExecution,
    eodStatusAndTask.EodStatus.ModulesExecuted,
    anyErrors);
    }
    else
    {
    eodRow = new EodRow(eodStatusAndTask.Task.Id,
    eodStatusAndTask.Task.TimeToFire,
    null,
    null,
    eodStatusAndTask.Task.StatusEnum,
    null,
    null,
    false);
    }
    eodRowList.Add(eodRow);
    }
    return eodRowList;
    }
    [WebMethod(EnableSession = true)]
    [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
    public int GetOverviewCount()
    {
    string environment = ((TaskEnvironment)HttpContext.Current.Session[WebConstants.SessionTaskEnvironment]).EnvironmentName;
    return EodDao.GetEodStatusRelatedTaskCount(environment);
    }
    • This reply was modified 11 years, 5 months ago by  sdalby.
    in reply to: Text orientation Text orientation #10043

    sdalby
    Member

    Hi serder,

    Unfortunately I havent been able to solved that either, but if you find out, I would be happy to know too.


    sdalby
    Member

    I have now managed to get it working on my own ASP.NET server.

    Thanks


    sdalby
    Member

    Hi Peter

    I am almost there. But it appears as if I am using the wrong content-type because Excel shows the xml rather than the formatted content.

    I use: application/vnd.ms-excel

    Is this correct?


    sdalby
    Member

    Yes, I see: It should be fairly easy to handle it my self on the server ๐Ÿ™‚

    Thanks, Peter


    sdalby
    Member

    Sorry our last posts overlapped, this sounds interesting and I will investigate the possibilities.

    Do you have any documentation? I could not find anything on exportdata.

    Btw, do you have additional information regarding the quistion on clibboard fetures? One of my users has already pointed out that he could copy/paste from the previous ASP.NET Gridview based picture.


    sdalby
    Member

    Actually, please disregard the discussion about access to your site, because I just realized that the server which runs this solution has no access to the internet at all.

    As damage control: Do you plans to allow users to copy cell or line values in a jqxGrid to the clipboard?


    sdalby
    Member

    I understand that you dont store it.

    Up until now I have *NOT* understood that the data was send on the internet at all. If I had not discovered this and wrote a program that transmitted customer or account related informaion to your site over the internet, I would be expelled and blacklisted.

    For now our focus are on less sensitive information, but I interprete your latest answer as if I cannot be sure that this feature will be available or my usage of it in a production scenario would be allowed.

    I can understand your position, but I really, really recommend that you state in your demo and documentation, that this feature can only be used by customers using PHP.

    Actually I am now in a delicate position because grids with Excel export was one of my selling points of jqWidgets in my organisation, and now I have to tell that it cannot be used at all.

    This information would have been nice to have initially.

    In a large organization you cannot just setup a PHP installation. You can only use pre-approved technologies based on a Development and Operations Strategy.

    • This reply was modified 11 years, 5 months ago by  sdalby.

    sdalby
    Member

    It doesnt fit in at all, I will have to wait for an ASP.NET version, but for now we maybe can use the current feature for techinal data. As a temporary improvement, I suggest that you turn on HTTPS for this.

    Thanks for your swift answer.


    sdalby
    Member

    Even though they are not saved there are no chance that I will get permission to post data to your server.

    How does the Server Side files distributed fit into an ASP.NET WebForms project?

    in reply to: Text orientation Text orientation #9946

    sdalby
    Member

    ๐Ÿ™‚ And now it works.

    Thanks

    in reply to: Text orientation Text orientation #9930

    sdalby
    Member

    Hi

    Thanks for your help, that swithced the text orientation perfectly.

    It did raise another issue though. I Show 20 bars, but only 11 of them have a legend text despite the fact that the tooltip shows that I have set the legend text for all 20.

    It can be reproduced in your example if you switch to 20 countries rather than 5.

    Best regards
    Sรธren

    in reply to: Dynamic contents Dynamic contents #9919

    sdalby
    Member

    It worked perfectly, thanks ๐Ÿ™‚

Viewing 15 posts - 16 through 30 (of 58 total)