var select2Options = { data: { results: myArrayOfResults } };
所以例如:
var select2Options = { data: { results: [ {text: "My shiny group",children: [ {id: 1,text: "My shiny item"},{id: 2,text: "My shiny item2"} ]} ] } };