jQWidgets Forums

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • in reply to: Auto-Resize Column Error Auto-Resize Column Error #14292

    aravindtrue
    Member

    Yeahh, though I provide the dataAdapter instance, It is not working.

    Anyways Thanks a lot for the response.

    Regards,
    Aravind MS

    in reply to: Auto-Resize Column Error Auto-Resize Column Error #14283

    aravindtrue
    Member

    Hi Peter,

    The cellsrenderer function is valid. I am consoling the “row” from cellsrenderer, when the page loads for the first time, it consoles the row numbers such as 0,1,2,3,4…..199. At the same time when resize the columns, the cellsrenderer function is triggered again and in that case it consoles an object. Please have a look at the following code,

    This example shows how to auto-resize the grid columns.

    $(document).ready(function () {
    var theme = getTheme();
    var url = “../sampledata/orders.xml”;
    // prepare the data
    var source =
    {
    datatype: “xml”,
    datafields: [
    { name: ‘ShippedDate’, map: ‘m\\:properties>d\\:ShippedDate’, type: ‘date’ },
    { name: ‘Freight’, map: ‘m\\:properties>d\\:Freight’, type: ‘float’ },
    { name: ‘ShipName’, map: ‘m\\:properties>d\\:ShipName’, type: ‘string’ },
    { name: ‘ShipAddress’, map: ‘m\\:properties>d\\:ShipAddress’, type: ‘string’ },
    { name: ‘ShipCity’, map: ‘m\\:properties>d\\:ShipCity’, type: ‘string’ },
    { name: ‘ShipCountry’, map: ‘m\\:properties>d\\:ShipCountry’, type: ‘string’ }
    ],
    root: “entry”,
    record: “content”,
    id: ‘m\\:properties>d\\:OrderID’,
    url: url
    };

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

    $(“#jqxgrid”).jqxGrid(
    {
    width: ‘100%’,
    source: source,
    theme: theme,
    columns: [
    { text: ‘Ship Name’, datafield: ‘ShipName’, width: 50, cellsrenderer: function(row, column, value){
    console.log(row);
    console.log(typeof row); //first time the page loads it is number and once we click the button the type object. why does this changes the behaviour?
    return row; //has valid return type
    }
    },
    { text: ‘Shipped Date’, datafield: ‘ShippedDate’, width: 30, cellsformat: ‘D’ },
    { text: ‘Freight’, datafield: ‘Freight’, width: 30, cellsformat: ‘F2’, cellsalign: ‘right’ },
    { text: ‘Ship Address’, datafield: ‘ShipAddress’, width: 50 },
    { text: ‘Ship City’, datafield: ‘ShipCity’, width: 100 },
    { text: ‘Ship Country’, datafield: ‘ShipCountry’}
    ]
    });
    $(“#button”).jqxButton({ theme: theme });
    $(“#button”).click(function () {
    $(“#jqxgrid”).jqxGrid(‘autoresizecolumns’);
    return false;
    });
    });

    in reply to: Auto-Resize Column Error Auto-Resize Column Error #14262

    aravindtrue
    Member

    Ohh Yeahh, It doesn’t have a return type. But I’m simply keeping a return type like the below,

    cellsrenderer: function(row, column, value){
    console.log(row);
    return row;
    }

    When page load the console logs, 1,2,3,4,5,6,…….199
    At the same time when I click the button the console logs,

    Object {
    Freight: 68.66
    ShipAddress: “Av. Copacabana, 267”
    ShipCity: “Rio de Janeiro”
    ShipCountry: “Brazil”
    ShipName: “Ricardo Adocicados”
    ShippedDate: Fri Mar 07 1997 05:30:00 GMT+0530 (India Standard Time)
    uid: 199
    }

    This changes the character of the row, so the action am doing

    for example,
    var sample = { 0: {}, 1: {}, 2{} }
    cellsrenderer: function(row, column, value){
    return sample[row][‘somedata’];
    }

    This is throwing me an error, is there any way to handle this?

    Regards,
    Aravind

    in reply to: Auto-Resize Column Error Auto-Resize Column Error #14260

    aravindtrue
    Member

    1. jQWidgets v2.6.0
    2.
    In Chrome 21.0,
    Uncaught TypeError: Cannot call method ‘toString’ of undefined jqxgrid.columnsresize.js:68

    In FF 15.0.1
    TypeError: column.cellsrenderer(row, column, text) is undefined
    text = column.cellsrenderer(row, column, text).toString();

    In Safari 5.1
    Error

    3. jQuery v1.8.2

    Regards,
    Aravind MS

    in reply to: Auto-Resize Column Error Auto-Resize Column Error #14253

    aravindtrue
    Member

    This is the error thrown from the js,

    Uncaught TypeError: Cannot call method ‘toString’ of undefined jqxgrid.columnsresize.js:68

    Regards,
    Aravind MS

    in reply to: Search Toolbar Clarification Search Toolbar Clarification #12118

    aravindtrue
    Member

    Shaser, this is a remote search example. dataAdapter can able to format the data, but it doesn’t have in-build filter functionality. The properties where the ‘data’ holds are the query string of the ajax request url.

    http://ws.geonames.org/searchJSON?callback=jQuery18204505064601544291_1355147014159&filterscount=0&groupscount=0&pagenum=0&pagesize=10&recordstartindex=0&recordendindex=18&featureClass=P&style=full&maxRows=20&name_startsWith=a

    Here, geonames.org has the query string called ‘name_startsWith’, which filters out and sends the response.

    You can simply use the filters,

    var filter1 = filtergroup.createfilter(‘stringfilter’, filtervalue, filtercondition);
    filtergroup.addfilter(filter_or_operator, filter1);
    $(“#Grid”).jqxGrid(‘addfilter’, datafield, filtergroup, true);

    Regards,
    Aravind.

    in reply to: Search Toolbar Clarification Search Toolbar Clarification #11897

    aravindtrue
    Member

    I figured it out, its really a silly question 🙂

    Regards,
    Aravind.


    aravindtrue
    Member

    Thanks a lot. I’ll update the jQwidgets version.

    Regards,
    Aravind

    in reply to: Disabled Checkbox in the Grid? Disabled Checkbox in the Grid? #11830

    aravindtrue
    Member

    Thank you.

    Regards,
    Aravind

    in reply to: Disabled Checkbox in the Grid? Disabled Checkbox in the Grid? #11828

    aravindtrue
    Member

    Yeah, but is there any option to give a disabled effect like the below one,

    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxbutton/index.htm?(classic)#demos/jqxbutton/checkbox.htm

    Regards,
    Aravind

    in reply to: Clarification in JSON Foramt Clarification in JSON Foramt #11621

    aravindtrue
    Member

    Yeah, fixed that in a different way.

    Thanks a lot for the quick response.

    in reply to: Clarification in JSON Foramt Clarification in JSON Foramt #11611

    aravindtrue
    Member

    I have got a small problem, if I have the following source format

    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘CompanyName’ },
    { name: ‘ContactName’ },
    { name: ‘ContactTitle’, map: ‘ContactTitle>old’},
    { name: ‘ContactTitle’, map: ‘ContactTitle>new’},
    { name: ‘Address’ },
    { name: ‘City’ },
    { name: ‘Country’ }
    ],
    localdata: data
    }

    var cols = [
    {text: ‘Company Name’, datafield: ‘CompanyName’},
    {text: ‘Contact Name’, datafield: ‘ContactName’},
    {text: ‘New Contact Name’, datafield: ‘ContactTitle’},
    {text: ‘Old Contact Name’, datafield: ‘ContactTitle’},
    {text: ‘Address’, datafield: ‘Address’},
    {text: ‘City’, datafield: ‘City’},
    {text: ‘Country’, datafield: ‘Country’},
    ]

    The ‘ContactTitle’ is overridden with new one. Is there way to display two columns with same datafield?


    aravindtrue
    Member

    Thanks, Its working great… 🙂


    aravindtrue
    Member

    <div id="jqxWidget" style="font-size: 13px; font-family: Verdana; float: left;">
    <div id="jqxgrid"></div>
    <input type="button" id="generate" value="Generate" />
    </div>


    aravindtrue
    Member

    Sorry for the in inconvenience. I didn’t paste the HTML. In that example,

    On page load, I am just building the grid. I have a button called “Generate” and when I click that, I am pushing the source, columns and on ready, I am trying to apply the filter where it is not working.

    Regards,
    Aravind

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