<Script>
function showDetails ( e)
{
var index = 0;
var grid = $( "#ActualRevenueSummary"). data( "kendoGrid ");
var dataItem = this. dataItem ( $( e. currentTarget ). closest( "tr"));
var value = $( '#ProjectId'). val ( );
var text = $( "#ProjectId"). data( "kendoDropDownList "). text( );
var Month = dataItem . MonthNumber ;
var MonthName = dataItem . MonthName;
var projectname = dataItem.projectname;
var NestId = $( this). data( 'id');
var url = "/ActualRevenueDetails/GetRevenueDetails? Id=" + value + "&&month=" + Month + "&&MonthName=" + MonthName + "&&projectName=" + text + "";
window . location. href = url;
}
</script >
----------------------------------------------------------------------------------
@( Html. Kendo( ). Grid<SPAN. OMS. ViewModel. ActualRevenueViewModel>()
. Name( "ActualRevenueSummary")
. Columns( columns =>
{
columns . Bound( p => p. RevenueSummaryId). Visible( false);
columns . Bound( p => p. ProjectId ). Visible( false);
columns . Bound( p => p. Year). Visible( false);
columns . Bound( p => p. MonthNumber). Visible( false);
columns . Bound( p => p. MonthName). Title( "Month");
columns . Bound( p => p. ResourceCount ). Title( "Total no. of Resrc"). Format( "{0: n2}");
columns . Bound( p => p. TotalBilledRsrcCount). Title( "Total no. of Billed Resrc"). Format( "{0: n2}");
columns . Bound( p => p. OffshoreAmount). Format( "{0: c2}"). Title( "Offshore Revenue");
columns . Bound( p => p. OnsiteAmount). Format( "{0: c2}"). Title( "Onsite Revenue");
columns . Bound( p => p. Travel). Title( "Travel Revenue"). Format( "{0: c2}");
columns . Bound( p => p. Hardware). Title( "H/W Revenue"). Format( "{0: c2}");
columns . Bound( p => p. Software). Title( "S/w Revenue"). Format( "{0: c2}");
columns . Bound( p => p. Misc). Title( "Misc Revenue"). Format( "{0: c2}");
columns . Bound( p => p. ComissionAmount). Title( "Commission"). Format( "{0: c2}"). ClientFooterTemplate( "Grand Total:");
columns.Bound(p => p.Total).Title("Revenue Total").ClientFooterTemplate("#= kendo.format('{0:c}', sum) #").Format("{0:c2}");
columns . Command( command => { command. Edit( ); } );
columns . Command( command => command . Custom( "ViewDetails "). Click( "showDetails "). Text( "<i class='fa fa-pencil-square-o fa-lg ' ></i >"));
}
)
. Resizable ( resizing => resizing. Columns( true))
. Events( events => events. DataBound( "DataBound"))
. Editable ( editabe => editabe . Mode( Kendo. Mvc. UI. GridEditMode. InLine))
. Events( events => events. Edit( "edit"))
. DataSource ( dataSource => dataSource
. Ajax( )
. Events( events => events. Error( "error_handler"))
. Events( events => events. Change( "isEditable "). Sync( "sync_handler"))
. Aggregates( aggregates =>
{
aggregates . Add( p => p. Total). Sum( );
})
. Model( model =>
{
model . Id( p => p. RevenueSummaryId);
model . Id( p => p. ProjectId );
model . Id( p => p. Year);
model . Id( p => p. MonthNumber);
model . Field( p => p. MonthName). Editable( false);
model . Field( p => p. ResourceCount ). Editable( false);
model . Field( p => p. TotalBilledRsrcCount). Editable( false);
model . Field( p => p. OffshoreAmount). Editable( false);
model . Field( p => p. OnsiteAmount). Editable( false);
model . Field( p => p. Travel). Editable( false);
model . Field( p => p. Hardware). Editable( false);
model . Field( p => p. Software). Editable( false);
model . Field( p => p. Misc). Editable( false);
model . Field( p => p. ComissionAmount). Editable( true);
model . Field( p => p. Total). Editable( true);
})
. Read( read => read. Action( "GetActualRevenueSummary", "ActualRevenue "). Data( "ItemFormValues"))
. Update( update => update. Action( "RevenueSummaryUpdate", "ActualRevenue "). Data( "ItemFormValues"))
)
)
{
}
</
----------------------------------------------------------------------------------
@
{
columns.Bound(p => p.Total).Title("Revenue Total").ClientFooterTemplate("#= kendo.format('{0:c}', sum) #").Format("{0:c2}");
}
)
{
})
{
})
)
)
No comments:
Post a Comment