من هم یک بار از jquery treeview استفاده کردم که اطلاعات رو از sql میگرفت از Ajax و JSON و Web Service استفاده کردم امیدوارم کمکت کنه :
SQL:
$(document).ready(function () {
var url = "http://192.168.2.2:8080/MyService.asmx/GetData";
var source =
{
datatype: "json",
datafields: [
{ name: 'ID', type: 'int' },
{ name: 'Parent' },
{ name: 'Caption' }
]
};
$.ajax({
type: 'GET',
dataType: 'json',
async: false,
url: url,
cache: false,
contentType: 'application/json; charset=utf-8',
success: function (data) {
source.localdata = data.d;
},
error: function (request, status, error) {
alert(request.responseText);
}
});
});
XML :
$(document).ready(function () {
var url = "../sampledata/customers.xml";
var source =
{
datatype: "xml",
datafields: [
{ name: 'CompanyName', map: 'm\\:properties>d\\:CompanyName' },
{ name: 'ContactTitle', map: 'm\\:properties>d\\:ContactTitle' },
{ name: 'City', map: 'm\\:properties>d\\:City' },
{ name: 'Country', map: 'm\\:properties>d\\:Country' }
],
root: "entry",
record: "content",
id: 'm\\:properties>d\\:CustomerID',
url: url ,
async: false
};
});