var count = 0;
var cutEditor;var edit;
var typeid;
var categoryid;
$(function () {
cutEditor = UE.getEditor('editorCut');
edit = UE.getEditor('editor');
// alert();
var vNewsID = $("#hideID").val();
获取新闻对应条目信息
$.getJSON("/News/ShowNews", { ContentID: vNewsID }, function (data) {
var list = eval(data);
var vContent;
var vCutContent;
$.each(list, function (i, val) {
if (i == 'Content') { //text
vContent = val;
}
if (i == 'Title')//title
{
// alert(val);
$("#newstitle").val(val);
}
if (i == 'NewsCategoryID')//typeID
{
// alert(val+'fdfdfd');
categoryid = val;
// $("#newstype").val(val);
}
if (i == 'NewsContentRemark')//cut
{
vCutContent = val;
}
if (i == 'TypeID')//typeID
{
typeid = val;
}
if (i == 'FoundDate') {
$("#foundDate").val((eval(val.replace(/\/Date\((\d+)\)\//gi, "new Date($1)"))).pattern("yyyy-MM-dd hh:mm:ss"));
}
});
//获取新闻类型列表
//UE.getEditor('editorCut');
//UE.getEditor('editor');
$.getJSON("/News/GetNewsTypeList", {}, function (data) {
var list = eval(data);
$.each(list, function (i, val) {
$.each(val, function (j, arr) {
if (j >= 0 && arr.Id != undefined) {
if (arr.TypeID == typeid) {
$("#newstype").append("<option value='" + arr.Id + "'>" + arr.Name + "</option>");
}
}
});
});
// alert(categoryid);
$("#newstype").val(categoryid);
});
edit.addListener("ready", function () {
edit.setContent(vContent);
count = count++;
});
cutEditor.addListener("ready", function () {
cutEditor.setContent(vCutContent);
count = count++;
});
if (count == 0) {
edit.setContent(vContent);
cutEditor.setContent(vCutContent);
}
});
//
});