jQWidgets Forums

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Displaying links in jqxGrid Displaying links in jqxGrid #13240

    Suresh
    Member

    For some reason, some of the text in my previous message was supressed. Here is the cellsrenderer call:

    cellsrenderer: function(row, cell, value) {
    return '<a href="${pageContext.request.contextPath}/test/testApp/testAction?id='+value+'"/>'+value+'</a>'
    }
    in reply to: Displaying links in jqxGrid Displaying links in jqxGrid #13239

    Suresh
    Member

    Hi xetere,

    You can also find one of the examples here:

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

    Open the above link and search for “cellsrenderer”.

    In my sample application, i implemented it this way:

    $(“#jqxgrid”).jqxGrid(
    {
    width: ‘99%’,
    source: dataAdapter,
    altrows: true,
    sortable: true,
    autoheight: true,
    showsortcolumnbackground: false,
    pageable: true,
    enableellipsis: true,
    columns: [
    { text: ‘Column1’, datafield: ‘column1’, width: ‘40%’, cellsrenderer: function(row, cell, value) {
    return ‘‘+value+”}},
    { text: ‘Column2’, datafield: ‘column2’, width: ‘60%’},
    ]
    });

    in reply to: Displaying links in jqxGrid Displaying links in jqxGrid #11948

    Suresh
    Member

    Thanks Peter. I found an example for cellsrenderer in one of the forums and used it in my code. Its working fine.

    in reply to: Displaying links in jqxGrid Displaying links in jqxGrid #11940

    Suresh
    Member

    Hi Peter,

    Need your help again on the same topic. In your example you are using “formatlink” function and displaying the whole link (for ex: http://www.jqwidgets.com/community/topic/combobox-autocomplete-type/) in jqxGrid.

    I have gone thru function definition in jqxData.js and it is using the same value for link href and value.

    formatlink:function(b,d){var c=””;if(d&&d.target){c=”target=”+d.target}if(c!=””){return”‘+b+”“}return’‘+b+”“}

    In my example, i am trying to display the text as hyperlink. For example, i have a column called username (ex: suresh, john, david etc). In the grid, it should display the text as “suresh” but the if the user clicks on the link it should take the user to “http://www.abc.com/xyz?user=suresh”.

    Sample JSON i am using:

    [
    {
    “username”: “suresh”,
    “firstname”: “suresh”,
    “lastname”: “babu”
    },
    {
    “username”: “john”,
    “firstname”: “john”,
    “lastname”: “jevin”
    },
    {
    “username”: “david”,
    “firstname”: “david”,
    “lastname”: “martin”
    }
    ]

    Is there a jqx dataformat function that i can use to accomplish this?

    in reply to: Displaying links in jqxGrid Displaying links in jqxGrid #11939

    Suresh
    Member

    Thanks Peter for the quick reply. The example you provided is helpful.

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