jQuery UI Widgets › Forums › Grid › Need to change the back color property of the Button inside the grid
Tagged: javascript grid
This topic contains 5 replies, has 2 voices, and was last updated by kalaivani 12 years, 11 months ago.
-
Author
-
Hi Peter,
I have Button inside my jqxgrid using cellsrenderer. Need to change the back color of the Button like blue,yellow ,red etc based on some condition.
tried with BackColor=”#FF9933″ property but it displays as default color .How to do it ?
thanks..
Tried like input type=”button” BackColor=”#0033CC” class=”gridButton” but nothing reflected
Hi kalaivani,
The solution is to set the ‘style’ property of the Input tag.
For example:
{ text: 'First Name', dataField: 'firstname', width: 100, cellsrenderer: function (row, column, value) { return '<input value="' + value + '" type="button" style="background: #ff0000;"/>'; } },
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThanks 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
Hi kalaivani,
The cell’s value is passed to the cellsrenderer function. I suggest you using it as a conditional formatting parameter.However, if you want to read or load HTML file, you can use jQuery ajax – http://api.jquery.com/jQuery.ajax/.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comBy 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 ?
-
AuthorPosts
You must be logged in to reply to this topic.