url:'你的后台数据请求路径'。
dataSource: 'server' //可忽略此参数,默认为server -- -- -- - 后台返回固定格式的JSON数据: { "total": 5, "rows": [{ "id": 0, "num": "BQ_201905160854", "gender": 2, "age": 32, "email": "bigq517@qq.com", "mobile": "139*****517", "name": "\u8001\u738b_1", "datetime": 1557968092 }, { "id": 1, "num": "BQ_201905160854", "gender": 2, "age": 32, "email": "bigq517@qq.com", "mobile": "139*****517", "name": "\u8001\u738b_2", "datetime": 1557881692 }, { "id": 2, "num": "BQ_201905160854", "gender": 1, "age": 20, "email": "bigq517@qq.com", "mobile": "139*****517", "name": "\u8001\u738b_3", "datetime": 1557795292 }, { "id": 3, "num": "BQ_201905160854", "gender": 1, "age": 20, "email": "bigq517@qq.com", "mobile": "139*****517", "name": "\u8001\u738b_4", "datetime": 1557708892 }, { "id": 4, "num": "BQ_201905160854", "gender": 2, "age": 22, "email": "bigq517@qq.com", "mobile": "139*****517", "name": "\u8001\u738b_5", "datetime": 1557622492 }] }
我的意思是,一条数据只能有一个二级节点,不能有三个,比如第四行只有一个子节点是第五行,第六行并不是第四行的子节点
{"total": 7, "rows": [ { "id":1,"pid":0,"name":"Li","age":20}, { "id":2,"pid":0,"name":"Han","age":20}, { "id":3,"pid":0,"name":"Wang","age":20}, { "id": 4 , "pid": 0,"name": "那曲地区", "age": "15" }, { "id": 5, "pid": 4,"name": "阿里地区", "age": "30" }, { "id": 6, "pid": 4,"name": "日喀则地区", "age": "45" }, { "id": 7, "pid": 0,"name": "林芝地区", "age": "60" }]}
如果某个节点,他没有子节点,他也不能有兄弟节点。
就比如节点1,只有一个子节点2生效,其他几个不生效
{"total": 7, "rows": [ { "id":1,"pid":0,"name":"Li","age":20}, { "id":2,"pid":1,"name":"Han","age":20}, { "id":3,"pid":1,"name":"Wang","age":20}, { "id": 4 , "pid":1,"name": "zhang", "age": "15" }, { "id": 5, "pid": 1,"name": "zhao", "age": "30" }, { "id": 6, "pid": 1,"name": "biao", "age": "45" }, { "id": 7, "pid": 1,"name": "liu", "age": "60" }]}