-1
SharePointリストを照会しているJavaScriptファイルがあります。私は2つのドロップダウンリストを照会しています。最初のLifeCycleStatusは正常に戻ってきますが、優先度ドロップダウンはscreen grab [オブジェクトOBJECT]に戻ります。私はそれがvarクエリ文字列と関係があると思います。私は、VARクエリに「優先順位」列を追加しましたが、それは以下の[オブジェクトオブジェクト]を返すJavascriptのvarクエリ
var query = "http://collaboration-
de.vxxx.com/sites/it/SystemInventory/_vti_bin/listdata.svc/Devices?$expand=LifeCycleStatus&Priority&$filter=Id eq " + window.DeviceId + "";
詳しいJavaScriptの任意の違いを作っているように見えません。
function getDeviceDetails() {
var txtTitle = "";
var txtOverview = "";
var txtAccessories = "";
var txtDevicetype = "";
var txtTypicalDeviceUsage ="";
var txtKnownSystemIssues ="";
var txtLifeCycles = "";
var txtTrafficlight = "";
var tempLCS2 = "";
var query = "http://collaboration-dev.xxx/sites/it/SystemInventory/_vti_bin/listdata.svc/Devices?$expand=LifeCycleStatus&Priority&$filter=Id eq " + window.DeviceId + "";
var call = $.ajax({
url: query,
type: "GET",
dataType: "json",
headers: {
Accept: "application/json;odata=verbose"
}
});
call.done(function (data,textStatus, jqXHR){
$.each(data.d.results, function(index, item) {
var tempID = item.Id;
var tempTitle = item.Title;
var LifeCycleStart = item.DeviceAvailableFrom;
var LifeCycleStatus = item.LifeCycleStatusValue;
var DeviceOverView = item.Description;
var AccessDetails = item.Accessories;
var DeviceKind = item.Devicetype;
var Usage = item.TypicalUsage;
var DevicePriority = item.Priority;
txtTitle = "<p>" + LifeCycleStart + "</p><p>" + LifeCycleStatus + "</p>";
txtOverview = "<p>" + DeviceOverView + "</p>";
txtAccessories = "<p>" + AccessDetails + "</p>";
txtDevicetype = "<p>" + DeviceKind + "</p>";
txtTypicalDeviceUsage = "<p>" + Usage + "</p>";
txtTrafficlight = "<p>" + DevicePriority + "</p>";
// txtKnownSystemIssues = "<p>" + KnownSystem + "</p>"
});
$('#devicedetails').append($(txtTitle));
$('#deviceoverview').append($(txtOverview));
$('#devicekind').append(txtDevicetype);
$('#deviceacc').append(txtAccessories);
$('#deviceuse').append(txtTypicalDeviceUsage);
$('#devicestatus').append(txtTrafficlight);
});
call.fail(function (jqXHR,textStatus,errorThrown){
alert("Error retrieving data: " + jqXHR.responseText);
});
}
オブジェクトを文字列に変換しようとすると、 '[オブジェクトオブジェクト]'を返す '.toString'メソッドを使用して終了します – Rajesh
LifeCycleStatusドロップダウン・カラムの結果が返されるのは、 – Dazza
Rajeshさんに何をお勧めしますか? – Dazza