jQWidgets Forums
Forum Replies Created
-
Author
-
January 7, 2013 at 4:07 pm in reply to: Displaying links in jqxGrid Displaying links in jqxGrid #13240
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>'}
January 7, 2013 at 4:01 pm in reply to: Displaying links in jqxGrid Displaying links in jqxGrid #13239Hi xetere,
You can also find one of the examples here:
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%’},
]
});December 5, 2012 at 4:10 pm in reply to: Displaying links in jqxGrid Displaying links in jqxGrid #11948Thanks Peter. I found an example for cellsrenderer in one of the forums and used it in my code. Its working fine.
December 5, 2012 at 3:26 pm in reply to: Displaying links in jqxGrid Displaying links in jqxGrid #11940Hi 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?
December 5, 2012 at 2:46 pm in reply to: Displaying links in jqxGrid Displaying links in jqxGrid #11939Thanks Peter for the quick reply. The example you provided is helpful.
-
AuthorPosts