ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • window Ajax
    프로그래밍/Ext JS 4.26 2019. 9. 27. 15:19
    반응형
    Ext.Ajax.request({
        url: 'page.php',
        params: {
            id: 1
        },
        success: function(response){
            var text = response.responseText;
            // process server response here
        }
    });
    Ext.Ajax.timeout = 60000; // 60 seconds
    Ext.Ajax.timeout = 120000; // 120 seconds
    Ext.Ajax.request({
        url: 'page.aspx',
        timeout: 60000
    });

    1. 싱글 톤 인스턴스로 클래스는 서버 측 코드와 통신하는데 사용된다. 

    구조는 모든 언어가 그렇듯 비슷한 것 같다.

    URL로 params를 보내고 

    success시 함수를 실행시킨다. 

    text에 응답받은 값을 저장한다.


    2. 요청에 대한 기본 값은 클래스의 속성을 변경해서 설정 할 수 있다.

    3. 요청 시간 초과를 명령어로 줄 수 있다. 



    Ext.define('KitchenSink.view.panel.BasicPanels', {
        extend: 'Ext.Container',
        xtype: 'basic-panels',
        width: 660,
        requires: [
            'Ext.layout.container.Table'
        ],
    
        layout: {
            type: 'table',
            columns: 3,
            tdAttrs: { style: 'padding: 10px;' }
        },
    
        defaults: {
            xtype: 'panel',
            width: 200,
            height: 200,
            bodyPadding: 10
        },
    
        initComponent: function () {
            this.items = [
                {
                    html: KitchenSink.DummyText.mediumText
                },
                {
                    title: 'Title',
                    html: KitchenSink.DummyText.mediumText
                },
                {
                    title: 'Header Icons',
                    tools: [
                        { type:'pin' },
                        { type:'refresh' },
                        { type:'search' },
                        { type:'save' }
                    ],
                    html: KitchenSink.DummyText.mediumText
                },
                {
                    title: 'Collapsed Panel',
                    collapsed: true,
                    collapsible: true,
                    width: 640,
                    html: KitchenSink.DummyText.mediumText,
                    colspan: 3
                }
            ];
    
            this.callParent();
        }
    });


    -내용출처:https://docs.sencha.com/extjs/4.2.6/#!/example 


    반응형

    댓글

Designed by Tistory.