or
I have this situation:
I have some Views and by default they have assigned a Layout for them. The problem is that in some specific cases, I need to change the Layout of some of these Views in the Javascript file.
I am using this way:
$("#tabstrip-dash").setAttribute('data-layout', 'mobile-tabstrip-layout2');
This solution works only if I reload the application, but I want to change it instantly.
Is there any way to set the new Layout?
Thanks!
public
class
HomeMonitorViewModel {
public
int
Id {
get
;
set
; }
[Required, StringLength(255)]
public
string
Name {
get
;
set
; }
[Required, StringLength(128)]
public
string
HostSystem {
get
;
set
; }
public
string
Description {
get
;
set
; }
public
Data.MonitorClassification Classification {
get
;
set
; }
public
DateTime DateAdded {
get
;
set
; }
public
bool
HasBeenAdministered {
get
;
set
; }
public
Data.MonitorSource Source {
get
;
set
; }
public
int
MonitorAliasId {
get
;
set
; }
public
string
MonitorAliasName {
get
;
set
; }
}
public
enum
MonitorClassification {
Default = 1,
Standard = 2,
Bespoke = 3
}
public
enum
MonitorSource {
Policy = 1,
Adhoc = 2,
Unknown = 3
}
@(Html.Kendo().Grid<
ProjectBlackSun.Models.Home.HomeMonitorViewModel
>()
.Name("MonitorGrid")
.Columns(c => {
c.Bound(m => m.Name);
c.Bound(m=>m.MonitorAliasName);
c.Bound(m=>m.Description);
c.Bound(m=>m.HostSystem);
c.Bound(m=>m.Classification);
c.Bound(m=>m.Source);
})
.ToolBar(t => {
t.Create();
t.Save();
})
.Editable(e => e.Mode(GridEditMode.InCell))
.Pageable()
.Sortable()
.DataSource(d => d
.Ajax()
.Batch(true)
.ServerOperation(false)
.Events(e => e.Error("error_handler"))
.Model(model => model.Id(monitor => monitor.Id))
.Create("MonitorGridCreate", "Home")
.Read("MonitorGridRead", "Home")
.Update("MonitorGridUpdate", "Home")
.Destroy("MonitorGridDestroy", "Home")
)
)
<
script
type
=
"text/javascript"
>
function error_handler(e) {
if (e.errors) {
var message = "Errors:\n";
$.each(e.errors, function (key, value) {
if ('errors' in value) {
$.each(value.errors, function() {
message += this + "\n";
});
}
});
alert(message);
}
}
</
script
>