Skip to content

Instantly share code, notes, and snippets.



Last active Dec 14, 2015
What would you like to do?
Simple replacement check-tree.js file that uses ASN Common Core State Standards manifest with CORS enabled to select specific standards.
This file is part of Ext JS 4
Copyright (c) 2011 Sencha Inc
GNU General Public License Usage
This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met:
If you are unsure which license is appropriate for your use, please contact the sales department at
Ext.onReady(function() {
//Define a new 'asn' data model with certain fields from the manifest. Full list of available fields -
Ext.define('asn', {
extend: '',
fields : ['text', 'id']
//ASN manifest doesn't contain a field called 'checked', so let's add it on-the-fly
asn.prototype.fields.add(new{ name: 'checked', defaultValue: false}));
//add CORS support for ASN manifest request
Ext.Ajax.useDefaultXhrHeader = false;
Ext.Ajax.cors = true;
var store = Ext.create('', {
model: 'asn',
proxy: {
type: 'ajax',
url: '' //ASN manifest location
sorters: [{
property: 'leaf',
direction: 'ASC'
}, {
property: 'text',
direction: 'ASC'
var tree = Ext.create('Ext.tree.Panel', {
store: store,
rootVisible: false,
useArrows: true,
frame: true,
title: 'Check Tree',
renderTo: 'tree-div',
width: 500,
height: 250,
dockedItems: [{
xtype: 'toolbar',
items: {
text: 'Get checked nodes',
handler: function(){
//get the ASN URI from checked
var records = tree.getView().getChecked(),
names = [];
Ext.Array.each(records, function(rec){
title: 'Selected Nodes',
msg: names.join('<br />'),
icon: Ext.MessageBox.INFO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.