웹 개발

[sencha] html tag안에 객체 추가하기

노루아부지 2019. 8. 23. 23:57

1. script

<script type="text/javascript">
Ext.define('MyApp.store.MyTreeStore', {
    extend: 'Ext.data.TreeStore',
 
    requires: [
        'Ext.data.proxy.Ajax',
        'Ext.data.reader.Json'
    ],
 
    constructor: function(cfg) {
        var me = this;
        cfg = cfg || {};
        me.callParent([Ext.apply({
            storeId: 'MyTreeStore',
            root:{
             text:'root',
             expanded:true
            },
            proxy: {
                type: 'ajax',
                url: '/backoffice/buy/menuTreeList.ajax',
                reader: {
                    type: 'json'
                }
            }
        }, cfg)]);
    }
});
 
Ext.define('MyApp.view.MyTreePanel', {
    extend: 'Ext.tree.Panel',
 
    requires: [
        'Ext.tree.View'
    ],
 
    height: 250,
    width: 400,
    title: 'My Tree Panel',
    store: 'MyTreeStore',
    renderTo: "test",
 
    initComponent: function() {
        var me = this;
 
        Ext.applyIf(me, {
            viewConfig: {
 
            }
        });
 
        me.callParent(arguments);
    }
 
});
 
Ext.onReady(function() {
Ext.create('MyApp.store.MyTreeStore');
Ext.create('MyApp.view.MyTreePanel');
 
Ext.create('Ext.Button', {
     renderTo: "test",
     text: 'My Button',
     listeners: {
     }
  });
});
</script> 

 

2. HTML

<body>
	<table id="t">
		<colgroup>
			<col />
			<col width="100"/>
			<col />
		</colgroup>
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td id="test">&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
	</table>
</body>

 

 

 

728x90

'웹 개발' 카테고리의 다른 글

[select2] hide search bar  (0) 2019.08.24
java에서 원하는 character set으로 파일 읽고 쓰기  (0) 2019.08.24
[sencha] grid column replace  (0) 2019.08.23
[javascript] 원시타입 - Infinity  (0) 2019.08.23
[css] text 선택 방지  (0) 2019.08.23
loading