Mode one:
Data storage Model:
public class Calendarevent
{public
string ID {get; set;}
Public DateTime start {get; set;}
Public DateTime end {get; set;}
public string BackgroundColor {get; set;}
public string Title {get; set;}
public string AllDay {get; set;}
}
View Code
foreground receives display Data views View:
<script type= "Text/javascript" >
$ (function () {
//calendar handle data as follows:
var events = [];
$.ajax ({
URL: "/deploymenttask/calendardata",
success:function (data) {
events = Data
},
Async:false
});
$ ("#calendar"). Fullcalendar ({
header: {left
: ' Prev,next today ',
Center: ' title ',
//right: ' Month,agendaweek,agendaday ' right
: ' Month '
},
selectable:true,
weekmode: ' Variable ',//fixed, Variable,liquid
events:events,
defaulteventminutes:1440 //default event length of one day
}
; </script>
View Code
Background processing Data Controller controller:
public class Deploymenttaskcontroller:controller
{public
jsonresult calendardata ()
{
Operation op = New Operation ();
List<calendarevent> calendardata = Op. GetData ();
Return Json (CalendarData, jsonrequestbehavior.allowget);
}
View Code
Data style screenshot in transmission:
Mode two:
Data storage Model Models: This method does not use model storage, which is to pass strings string data (including string JSON data) to foreground page view views, using the model for data storage when passing JSON-type data. This is implemented using the string concatenation method
foreground receives display Data views View:
<script type= "Text/javascript" > $ (document). Ready (function () {var inidata = [];
$.ajax ({url: '/modifyinifile/showinifiledata ', success:function (data) {
Inidata = data;
}, Async:false});
$ (' #tt '). Tree ({method: ' Get ', Data:inidata, Checkbox:true,
Lines:true, Animate:true, Oncheck:function (node,checked) {
alert (node.checked);
alert (node.target);
Changekeydata = Node.text;
Changevaluedata = node.checked; Changedata + + "*" +changekeydata + "|"
+ Changevaluedata;
}, Onlyleafcheck:true, cascadecheck:false});}); </script>
View Code
Background processing Data Controller controller:
public class Modifyinifilecontroller:controller {////Get
:/modifyinifile/public
Contentresult Showinifiledata ()
{
string jsondata = Op. Getinifiledata ();
return new Contentresult {Content = jsondata, ContentType = ' Application/json '}}
View Code
Data style screenshot in transmission:
I use and this, the next encounter to write again, thank you. (Please instruct if there is any defect)