PDA

View Full Version : [CLOSED] How to GetRowClass will work in v2.x



jesperhp
Feb 10, 2014, 11:37 AM
Hi I am using GetRowClass to change the colors of row on date bases in v1.1 but this not work in v2.x
How could GetRowClass function will work in v2.x


<style type="text/css">
.red
{
background: red;
}
.green
{
background: green;
}
.yellow
{
background: yellow;
}
.x-label
{
margin-top: 3px;
float: left;
}
</style>
<script type="text/javascript">
function getRowClass(record) {
var currentDateTime = new Date();
if (record.data.ExpectedDate != null) {
if (record.data.ExpectedDate < currentDateTime) {
return 'green';
}
}
if (record.data.Reminder != null) {
if (record.data.Reminder < currentDateTime) {
return 'yellow';
}
}
if (record.data.DeadLine != null) {
if (record.data.DeadLine < currentDateTime) {
return 'red';
}
}
}
</script>
<ext:Viewport ID="RequestActiviesGridViewPort" runat="server" Layout="Fit">
<Items>
<ext:Panel ID="PanelContent" runat="server" Layout="FitLayout" Region="Center">
<Items>
<ext:GridPanel ID="GridPanel_Requests" runat="server" IDMode="Explicit" FireSelectOnLoad="true">
<View>
<ext:GroupingView>
<GetRowClass Fn="getRowClass" />
</ext:GroupingView>
</View>
</ext:GridPanel>
</Items>
</ext:Panel>
</Items>
</ext:Viewport>




Thanks

Vladimir
Feb 10, 2014, 12:39 PM
Please see
http://examples2.ext.net/#/GridPanel/Miscellaneous/Marking_Records/

jesperhp
Feb 11, 2014, 10:28 AM
Please see
http://examples2.ext.net/#/GridPanel/Miscellaneous/Marking_Records/


Now getRowClass function working without any bug/issue but the color of row does not change


<script type="text/javascript">
function getRowClass(record) {
console.log(record);
var currentDateTime = new Date();
if (record.ExpectedDate != null) {
if (record.ExpectedDate < currentDateTime) {

return 'green';
}
}
if (record.Reminder != null) {
if (record.Reminder < currentDateTime) {
return 'yellow';
}
}
if (record.DeadLine != null) {
if (record.DeadLine < currentDateTime) {
return 'red';
}
}
}
</script>

Daniil
Feb 11, 2014, 12:35 PM
Please inspect the HTML elements and its CSS rules to determine whatever your CSS rules is not applied at all or overridden by something.

This helps to understand what I mean by inspecting HTML elements and its CSS rules.
CSS Change TabPanel Header Color - Ext.NET on Vimeo (http://vimeo.com/10076549)

jesperhp
Feb 12, 2014, 11:59 AM
Please inspect the HTML elements and its CSS rules to determine whatever your CSS rules is not applied at all or overridden by something.

This helps to understand what I mean by inspecting HTML elements and its CSS rules.
CSS Change TabPanel Header Color - Ext.NET on Vimeo (http://vimeo.com/10076549)


Thanks

Please close that thread