jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 29 total)
  • Author
    Posts
  • in reply to: Column Width resize Column Width resize #4604

    kalaivani
    Member

    Ok Let me download the latest version and try it .

    1. Any idea how to clearinterval in code behind?
    For every 5 sec it getting data from Json file .at certain time i should stop that process,as this process is started when the application starts and stops when the application end.Which is not recommended.

    2. is it possible to display the Link column value as “Link” and internally it should store the respective path and redirect to it when the user click on the Link?
    Currently the whole path is displayed in the grid and redirected to that path when user clicks.

    in reply to: Column Width resize Column Width resize #4601

    kalaivani
    Member

    am using jQWidget 2.0 version .
    What is new with 2.2 version ?

    in reply to: Column Width resize Column Width resize #4573

    kalaivani
    Member

    I think its because of iam setting as static Width as 100 .If i remove the static width then i cant able to resize it.

    How to set the column Width on refresh i.r set interval function ?

    in reply to: Column Width resize Column Width resize #4570

    kalaivani
    Member

    It allows me to resize it .But the Filling function will call for every 5 sec ,for next refresh it will goes to original position .
    Question 1 : How to retain the changed width ?
    Question 2 : One of my column is Link field.Is it possible to just display the “Link” as text in that column and by internal it should take its respective path for redirection ?
    Question 3 : How to stop the setinterval at code behind?

    My script is below

    $(document).ready(function () {
    function getdata() {
    var data = ‘{“Products”:[{“PNum”:”1001″,”Description”:”Product1″, “Stock”: “10”}, {“PNum”:”1002″,”Description”:”Product2″, “Stock”: “20”}]}’;
    var source =
    {
    datatype: “json”,
    async: false,
    datafields: [
    { name: ‘Id’ },
    { name: ‘FileName’ },
    { name: ‘Link’ },
    { name: ‘user’ }
    ],
    id: “id”,
    url: ‘api/Files/’
    };

    var dataAdapter = new $.jqx.dataAdapter(source);
    $(“#jqxgrid”).bind(‘bindingcomplete’, function () {

    });
    // //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;
    }
    var linkrenderer = function (id, row, column, value) {
    var datarow = $(‘#jqxgrid’).jqxGrid(‘getcellvalue’, id, “Link”);
    // For link
    if (value.indexOf(‘#’) != -1) {
    value = value.substring(0, value.indexOf(‘#’));
    }
    var format = { target: ‘”_blank”‘ };

    var html = $.jqx.dataFormat.formatlink(datarow, format);

    return html;

    }
    $(“#jqxgrid”).jqxGrid(
    {
    source: dataAdapter,
    pageable: true,
    autoheight: true,
    columnsresize: true,
    pagerrenderer: pagerrenderer,
    columns: [
    { text: ‘First Name’, dataField: ‘Id’, width: 100 },
    { text: ‘Last Name’, dataField: ‘FileName’, width: 100 },
    { text: ‘Product’, dataField: ‘Link’,cellsrenderer: linkrenderer},
    { text: ‘user’, dataField: ‘user’ }
    ]
    });
    }

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

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

    });


    kalaivani
    Member

    By using this in cell render function i can able to see the html content in the alert

    $.get(“http://localhost/datafile.html”, function (data) {
    alert(“Data Loaded: ” + data);
    });

    I need to store that data into string and i need to search for some string like “Information” is available or not in that data, to decide the color status.

    Is it possible to store the data into string variable and search for some specific string ?


    kalaivani
    Member

    Thanks you Peter .

    How to read the HTML file inside the cellrenderer function ? i have to change the color of it based on the content in HTML file


    kalaivani
    Member

    Tried like input type=”button” BackColor=”#0033CC” class=”gridButton” but nothing reflected


    kalaivani
    Member

    Thanks Peter.

    i have solved that by implementing like

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

    now the script error is not reporting…


    kalaivani
    Member

    is thr any option to check like

    if (!( $(“#jqxgrid”).jqxGrid(‘getpaginginformation’) === ‘undefined’)) before getting the pagenum?


    kalaivani
    Member

    Iam using VS2010 and Asp.net 4.0 in IE 9.

    I replaced with you code .

    As i informed you before i got Grid view Flickered once at the last updation .At that time Grid view is not available in that page it getting refreshed(disappears and then appears) for a sec ,when the function tries to get page number at that time var page = $(“#jqxgrid”).jqxGrid(‘getpaginginformation’).pagenum;
    am getting that error.

    When i press ignore then it works as expected .

    Are you using different IE ?


    kalaivani
    Member

    Is that code working for you ?
    For me initial execution itself showing error and the function is not called again.Grid View is not available in my page now.


    kalaivani
    Member

    Peter,

    yes i too done like the code posted by you .iam getting the same error unable to set the property value .
    i have send my code to support@jqwidgets.com.

    Please go through it.What wrong i done on it ?


    kalaivani
    Member

    I tried as per your code ..
    but am getting like unable to get the value of property ‘pagenum’ object is null or undefined when var page = $(“#jqxgrid”).jqxGrid(‘getpaginginformation’).pagenum; executes.


    kalaivani
    Member

    I have tried with implementing by getting the pagenumber in Pagerender function and used gotopage function in bindingcomplet function.

    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;
    }

    $(“#jqxgrid”).bind(‘bindingcomplete’, function () {
    $(“#jqxgrid”).jqxGrid(‘gotopage’, pagenum);
    }

    But again the same behaviour as it go to first page .How to do it ?


    kalaivani
    Member

    Thanks again Peter.

    -yes the “Show Row ” is working fine after uploading the JQuery 1.7.2.

    -Page navigation – Where to store the current page number and where to use this goto page method in my code? It should navigate to the page as per the user selection.

    – Flickering in the sense for 1 sec the grid view disappears and appears.

Viewing 15 posts - 1 through 15 (of 29 total)