sync
This commit is contained in:
@@ -16,10 +16,11 @@ function ShowIdlehours(data) {
|
||||
r[j] = r[j] === true ? "Yes" : "";
|
||||
else if (j === "UOM")
|
||||
r[j] = "Hour";
|
||||
else if (j === "AsofTimeLocal")
|
||||
r[j] = { DisplayValue: r["ReceivedDateStr"], Value: r[j] };
|
||||
}
|
||||
r.Hours = r.Hours.toFixed(2);
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
r.Hours = { DisplayValue: r.Hours.toFixed(2), Value: r.Hours };
|
||||
rows.push(r);
|
||||
|
||||
//if (r.DataSource.toLowerCase() == "calamp")
|
||||
// hasCalamp = true;
|
||||
@@ -39,19 +40,14 @@ function ShowIdlehours(data) {
|
||||
}
|
||||
|
||||
function InitIdlehourGridData() {
|
||||
grid_idlehourdt = new GridView('#idlehourlist');
|
||||
grid_idlehourdt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_idlehourdt = createGridView('#idlehourlist');
|
||||
var list_columns = [
|
||||
{ name: 'IsPrimary', caption: GetTextByKey("P_MA_ISPRIMARY", "Is Primary"), valueIndex: 'IsPrimary', css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'DataSourceName', caption: GetTextByKey("P_MA_DATASOURCE", "Data Source"), valueIndex: 'DataSourceName', css: { 'width': 120, 'text-align': 'left' } },
|
||||
{ name: 'Hours', caption: GetTextByKey("P_MA_IDLEHOURS", "Idle Hours"), valueIndex: 'Hours', css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'Units', caption: GetTextByKey("P_MA_UNITS", "Units"), valueIndex: 'UOM', css: { 'width': 80, 'text-align': 'left' } },
|
||||
{ name: 'ReceivedDate', caption: GetTextByKey("P_MA_RECEIVEDDATE", "Received Date"), valueIndex: 'ReceivedDateStr', css: { 'width': 130, 'text-align': 'left' } },
|
||||
{ name: 'SetPrmary', caption: "", css: { 'width': 100, 'text-align': 'left' } }
|
||||
{ name: 'ReceivedDate', caption: GetTextByKey("P_MA_RECEIVEDDATE", "Received Date"), valueIndex: 'AsofTimeLocal', css: { 'width': 130, 'text-align': 'left' } },
|
||||
{ name: 'SetPrmary', caption: "", css: { 'width': 30, 'text-align': 'left' } }
|
||||
];
|
||||
var columns = [];
|
||||
// head
|
||||
@@ -68,8 +64,10 @@ function InitIdlehourGridData() {
|
||||
col.type = list_columns[hd].type;
|
||||
}
|
||||
if (col.name === "SetPrmary") {
|
||||
col.isurl = true;
|
||||
col.text = GetTextByKey("P_MA_SETASPRIMARY", 'Set As Primary');
|
||||
col.sortable = false;
|
||||
col.resizable = false;
|
||||
col.type = GridView.ColumnTypes.Icon;
|
||||
col.text = "key"; //GetTextByKey("P_MA_SETASPRIMARY", 'Set As Primary');
|
||||
col.events = {
|
||||
onclick: function () {
|
||||
openSetPrimary(3, this);
|
||||
@@ -85,28 +83,16 @@ function InitIdlehourGridData() {
|
||||
};
|
||||
col.attrs = { 'title': GetTextByKey("P_MA_SETASPRIMARY", 'Set As Primary') };
|
||||
col.visible = IsSupperAdmin;
|
||||
col.resizable = false;
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_idlehourdt.canMultiSelect = false;
|
||||
grid_idlehourdt.multiSelect = false;
|
||||
grid_idlehourdt.columns = columns;
|
||||
grid_idlehourdt.init();
|
||||
|
||||
grid_idlehourdt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_idlehourdt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function InitIdlehourHisGridData() {
|
||||
grid_idlehourhisdt = new GridView('#idlehourhislist');
|
||||
grid_idlehourhisdt.lang = {
|
||||
all: GetTextByKey("P_GRID_ALL", "(All)"),
|
||||
ok: GetTextByKey("P_GRID_OK", "OK"),
|
||||
reset: GetTextByKey("P_GRID_RESET", "Reset")
|
||||
};
|
||||
grid_idlehourhisdt = createGridView('#idlehourhislist');
|
||||
var list_columns = [
|
||||
{ name: 'DeviceAirId', caption: GetTextByKey("P_MA_DEVICEAIRID", "Device Air ID"), valueIndex: 'DeviceAirId', css: { 'width': 140, 'text-align': 'left' } },
|
||||
{ name: 'AsofTime', caption: GetTextByKey("P_MA_EVENTDATEUTC", "Event Date(UTC)"), valueIndex: 'EventTimeText', css: { 'width': 130, 'text-align': 'left' } },
|
||||
@@ -133,15 +119,9 @@ function InitIdlehourHisGridData() {
|
||||
}
|
||||
columns.push(col);
|
||||
}
|
||||
grid_idlehourhisdt.canMultiSelect = false;
|
||||
grid_idlehourhisdt.multiSelect = false;
|
||||
grid_idlehourhisdt.columns = columns;
|
||||
grid_idlehourhisdt.init();
|
||||
|
||||
grid_idlehourhisdt.selectedrowchanged = function (rowindex) {
|
||||
var rowdata = grid_idlehourhisdt.source[rowindex];
|
||||
if (rowdata) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -248,8 +228,7 @@ function ShowIdlehourHis(data) {
|
||||
if (j === "EventTimeLocalText")
|
||||
r[j] = { DisplayValue: r["EventTimeLocalText"], Value: r["AsofTime_Local"] };
|
||||
}
|
||||
var fr = { Values: r };
|
||||
rows.push(fr);
|
||||
rows.push(r);
|
||||
}
|
||||
grid_idlehourhisdt.sortIndex = -1;
|
||||
grid_idlehourhisdt.sortDirection = -1;
|
||||
|
||||
Reference in New Issue
Block a user