jQWidgets Forums

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts

  • kalees
    Member

    Hi Peter,

    Thank you for your reply;

    There is no much work on serverside code. In a button click i do this. Just create some empty html files and create a link.

    Again I clear you here,
    In the IIS DefaultAppPool, If the maximum Workerprocess number is 1 (Default), I am getting data without any issue.
    After I changed to 4, Then i could not see the data. I meant to say Grid is showing data during the process, then data are disappeared in the process completed. But API data is still alive.
    Server side code also completed without anhy issue.

    Without stopping the page, again i am changing the worker process to 1, then I click the button, it is fine, I am getting the data.

    My doubt is, WebGarden is not supporting InProc Session state in AspNet. It may be any limitation on clientside script running.

    public void Button1_Click(object sender, EventArgs e)
    {

    Label2.Text = “0”;

    ConvertedFilesController cfc = new ConvertedFilesController();

    cfc.Delete(Page.User.Identity.Name); // To delete the files from the Api

    for (int i = 5; i < 20; i++)
    {
    string grouplevel = "";
    if (i = 9 && i < 11)
    grouplevel = "Success";
    else
    grouplevel = "File with Error";
    Thread.Sleep(100);
    Debug.WriteLine("task" + i);
    string filename = "Unit" + i;
    string filelink = "Reports/kalees/" + filename + ".html";
    try
    {
    File.Create(@"C:\JQueryGridview_demo\JQueryGridview_demo\" + filelink);
    }
    catch (IOException ioe)
    { }
    string uName = Page.User.Identity.Name;

    cfc.PostFile(filename, filelink, uName, "RED", grouplevel);
    }
    Label1.Text = "Button1 processed";
    ViewState["Processed"] = "true";

    Label2.Text = "1";

    }


    kalees
    Member

    Hi Peter,

    Actuallay, Grid is displaying the data during the process and at last it is disappear with no data. Can you pls verify the below script.
    It is very basic and straight forward;

    It is working fine, if one worker process is running with one apppool; but it is not one AppPool with multiple worker process;

    Here is my jquery script; PerformMe is the class name of Button1;

    I verified the API object also and it is living with its data but i could it get the final data on the grid.

    i tried your example in Refresh Grid button; But i do not know how to call the GetData method?

    I added here refresh button and help me on how to refresh the Json grid data;

    Thanks in advance

    $(document).ready(function () {
    var theme = getTheme();
    function getdata() {
    var source =
    {
    datatype: “json”,
    async: false,
    datafields: [
    { name: ‘Id’ },
    { name: ‘FileName’ },
    { name: ‘Link’ },
    { name: ‘UserName’ },
    { name: ‘ColorStatus’ },
    { name: ‘GroupLevel’ }
    ],
    id: “id”,
    url: ‘api/ConvertedFiles/’
    };

    var dataAdapter = new $.jqx.dataAdapter(source);

    // //page rendering – anchor tag
    var pagerrenderer = function () {
    var element = $(“

    “);
    var paginginfo = $(“#jqxgrid”).jqxGrid(‘getpaginginformation’);
    for (i = 0; i < paginginfo.pagescount; i++) {
    // add anchor tag with the page number for each page.
    var anchor = $("” + i + ““);
    anchor.appendTo(element);
    anchor.click(function (event) {
    // go to a page.
    var pagenum = parseInt($(event.target).text());
    $(“#jqxgrid”).jqxGrid(‘gotopage’, pagenum);
    });
    }
    return element;
    }
    //For Report Link Button
    var makeAddToListButton_html = function (id, row, column, value) {
    var filename = $(‘#jqxgrid’).jqxGrid(‘getcellvalue’, id, “FileName”);
    var datarow = $(‘#jqxgrid’).jqxGrid(‘getcellvalue’, id, “Link”);
    //Link
    if (value.indexOf(‘#’) != -1) {
    value = value.substring(0, value.indexOf(‘#’));
    }
    var format = { target: ‘”_blank”‘ };
    var html = $.jqx.dataFormat.formatlink(datarow, format);
    // return html;
    return ‘‘ + filename + ‘
    //Button
    // return ”
    }
    // For Status Color display
    var makeAddTostatusButton_html = function (id, row, column, value) {

    var status = $(‘#jqxgrid’).jqxGrid(‘getcellvalue’, id, “ColorStatus”);
    var colvar = status;

    return ”
    }

    $(“#jqxgrid”).bind(‘bindingcomplete’, function () { $(“#jqxgrid”).jqxGrid(‘sortby’, ‘GroupLevel’, ‘asc’); });
    $(“#jqxgrid”).bind(“sort”, function (event) { var sortinformation = event.args.sortinformation; var sortdirection = sortinformation.sortdirection; var sortcolumn = sortinformation.sortcolumn; });

    $(“#jqxgrid”).jqxGrid(
    {
    source: dataAdapter,
    pageable: true,
    autoheight: true,
    sortable: true,
    pagerrenderer: pagerrenderer,
    theme: theme,
    width: 750,
    columns: [

    { text: ‘File Name’, cellsrenderer: makeAddToListButton_html, dataField: ‘FileName’, width: 550, sortable: false },
    //{ text: ‘Link’, cellsrenderer: makeAddToListButton_html, dataField: ‘Link’, width: 50 },
    {text: ‘Status’, cellsrenderer: makeAddTostatusButton_html, dataField: ‘ColorStatus’, width: 50, sortable: false },
    { text: ‘Description’, dataField: ‘GroupLevel’, width: 150 }

    ]
    });
    // init buttons.
    $(“#refresh”).jqxButton({ theme: theme });
    $(“#clear”).jqxButton({ theme: theme });
    $(“#refresh”).click(function () {
    $(“#jqxgrid”).jqxGrid(‘updatebounddata’);
    });
    $(“#clear”).click(function () {
    $(“#jqxgrid”).jqxGrid(‘clear’);
    });

    }

    $(‘.PerformMe’).live(‘click’,
    function (e) {
    RefreshGrid();
    });

    function RefreshGrid() {
    var stopInterval = false;
    var stopIntervalId = setInterval(function () {

    if ($(“#jqxgrid”).jqxGrid(‘getpaginginformation’) == undefined) {
    var page = 0;
    }
    else {
    var page = $(“#jqxgrid”).jqxGrid(‘getpaginginformation’).pagenum;
    }

    var ConversionMode = $(‘#’).text();

    if (ConversionMode == 1)
    stopInterval = true;

    if (stopInterval) {
    getdata();
    $(‘#’).html(“0”);
    alert(“I am stopped”);
    clearInterval(stopIntervalId);
    }
    else {
    getdata();
    }

    $(“#jqxgrid”).jqxGrid(‘gotopage’, page);
    }, 1000);
    }
    });


    kalees
    Member

    Hi Peter,

    Thank you for you help.

    The sample is working fo me.

    I am trying now with my actual problem which i posted earlier.

    i will come back after some practice.

    Regards
    Kalees


    kalees
    Member

    Hi Peter,

    I checked it and I given full path too. But it does not work for me.

    Ok. i tried the sample of getting started program too.

    but finally i got page error
    Webpage error details . If possible can u please help me with any of your simple sample apps.

    this will help me a lot.

    Is any license issue?

    anyhow see the details below for Error [I copied the sample code after the error details]

    Regards
    Kalees
    Error:
    ===============================================
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)
    Timestamp: Mon, 30 Jul 2012 08:26:16 UTC

    Message: Invalid character
    Line: 1
    Char: 1
    Code: 0
    URI: file:///C:/Kalees/Task/Pract/jQWidget/scripts/jquery-1.6.2.min.js

    Message: ‘jQuery’ is undefined
    Line: 7
    Char: 1
    Code: 0
    URI: file:///C:/Kalees/Task/Pract/jQWidget/jqwidgets/jqxcore.js

    Message: ‘jQuery’ is undefined
    Line: 7
    Char: 1
    Code: 0
    URI: file:///C:/Kalees/Task/Pract/jQWidget/jqwidgets/jqxdata.js

    Message: ‘jQuery’ is undefined
    Line: 7
    Char: 1
    Code: 0
    URI: file:///C:/Kalees/Task/Pract/jQWidget/jqwidgets/jqxbuttons.js

    Message: ‘jQuery’ is undefined
    Line: 7
    Char: 1
    Code: 0
    URI: file:///C:/Kalees/Task/Pract/jQWidget/jqwidgets/jqxscrollbar.js

    Message: ‘jQuery’ is undefined
    Line: 7
    Char: 1
    Code: 0
    URI: file:///C:/Kalees/Task/Pract/jQWidget/jqwidgets/jqxmenu.js

    Message: ‘jQuery’ is undefined
    Line: 7
    Char: 1
    Code: 0
    URI: file:///C:/Kalees/Task/Pract/jQWidget/jqwidgets/jqxgrid.js

    Message: ‘jQuery’ is undefined
    Line: 7
    Char: 1
    Code: 0
    URI: file:///C:/Kalees/Task/Pract/jQWidget/jqwidgets/jqxgrid.selection.js

    Message: Object expected
    Line: 35
    Char: 5
    Code: 0
    URI: file:///C:/Kalees/Task/Pract/jQWidget/jQWidget.html

    ======================
    I Copied the sample code here
    =====================

    // prepare the data
    var data = new Array();
    var firstNames = [“Andrew”, “Nancy”, “Shelley”, “Regina”, “Yoshi”, “Antoni”, “Mayumi”, “Ian”, “Peter”, “Lars”, “Petra”, “Martin”, “Sven”, “Elio”, “Beate”, “Cheryl”, “Michael”, “Guylene”];
    var lastNames = [“Fuller”, “Davolio”, “Burke”, “Murphy”, “Nagase”, “Saavedra”, “Ohno”, “Devling”, “Wilson”, “Peterson”, “Winkler”, “Bein”, “Petersen”, “Rossi”, “Vileid”, “Saylor”, “Bjorn”, “Nodier”];
    var productNames = [“Black Tea”, “Green Tea”, “Caffe Espresso”, “Doubleshot Espresso”, “Caffe Latte”, “White Chocolate Mocha”, “Cramel Latte”, “Caffe Americano”, “Cappuccino”, “Espresso Truffle”, “Espresso con Panna”, “Peppermint Mocha Twist”];
    var priceValues = [“2.25”, “1.5”, “3.0”, “3.3”, “4.5”, “3.6”, “3.8”, “2.5”, “5.0”, “1.75”, “3.25”, “4.0”];
    for (var i = 0; i < 1000; i++) {
    var row = {};
    var productindex = Math.floor(Math.random() * productNames.length);
    var price = parseFloat(priceValues[productindex]);
    var quantity = 1 + Math.round(Math.random() * 10);
    row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
    row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
    row["productname"] = productNames[productindex];
    row["price"] = price;
    row["quantity"] = quantity;
    row["total"] = price * quantity;
    data[i] = row;
    }
    var source = { localdata: data, datatype: "array" };

    $("#jqxgrid").jqxGrid({
    source: source,
    columns: [{ text: 'First Name', datafield: 'firstname', width: 100 },
    { text: 'Last Name', datafield: 'lastname', width: 100 },
    { text: 'Product', datafield: 'productname', width: 180 },
    { text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
    { text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
    { text: 'Total', datafield: 'total', width: 100, cellsalign: 'right', cellsformat: 'c2'}]
    });

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