extJs  simple  grid  수정가능





<html>
<head>
</head>
<link rel="stylesheet" type="text/css" charset="UTF-8" href="./theme-gray-all.css" />


<style type="text/css">
</style>


<script type="text/javascript" charset="UTF-8" src="./ext-all.js"></script>


<body>


<script language='javascript' >


Ext.onReady(function(){


  Ext.define('User', {
      extend: 'Ext.data.Model',
      fields: [ 'name', 'email', 'phone' ]
  });


  var userStore = Ext.create('Ext.data.Store', {
      model: 'User',
      data: [
         { name: 'Lisa', email: 'lisa@simpsons.com', phone: '555-111-1224' },
         { name: 'Bart', email: 'bart@simpsons.com', phone: '555-222-1234' },
         { name: 'Homer', email: 'homer@simpsons.com', phone: '555-222-1244' },
         { name: 'Marge', email: 'marge@simpsons.com', phone: '555-222-1254' }
      ]
  });    
    
  Ext.create('Ext.grid.Panel', {
      renderTo: document.body,
      store: userStore,
      width: 400,
      height: 200,
      title: 'Application Users',
      editable : true, 
      columns: [
          {
              text: 'Name',
              width: 100,
              sortable: false,
              hideable: false,
              dataIndex: 'name'
          },
          {
              text: 'Email Address',
              width: 150,
              dataIndex: 'email',
              hidden: true
          },
          {
              text: 'Phone Number',
              flex: 1,
              dataIndex: 'phone',
               editor: {
                xtype:'textfield',
                allowBlank:false
              },              
              editable: true
          }
      ],      
      plugins: [
        Ext.create('Ext.grid.plugin.CellEditing', {
            clicksToEdit: 1
        })
      ] 
  }); 
    
});




</script>
<title>Simple Grid Sample for ExtJs</title>
</body>
</html>





 

 

Posted by 혜화초보
,
 
 
 






<html>
<head>
</head>
<link rel="stylesheet" type="text/css" charset="UTF-8" href="./theme-gray-all.css" />


<style type="text/css">
</style>


<script type="text/javascript" charset="UTF-8" src="./ext-all.js"></script>


<body>


<script language='javascript' >


Ext.onReady(function(){


  Ext.define('User', {
      extend: 'Ext.data.Model',
      fields: [ 'name', 'email', 'phone' ]
  });


  var userStore = Ext.create('Ext.data.Store', {
      model: 'User',
      data: [
         { name: 'Lisa', email: 'lisa@simpsons.com', phone: '555-111-1224' },
         { name: 'Bart', email: 'bart@simpsons.com', phone: '555-222-1234' },
         { name: 'Homer', email: 'homer@simpsons.com', phone: '555-222-1244' },
         { name: 'Marge', email: 'marge@simpsons.com', phone: '555-222-1254' }
      ]
  });    
    
  Ext.create('Ext.grid.Panel', {
      renderTo: document.body,
      store: userStore,
      width: 400,
      height: 200,
      title: 'Application Users',
      columns: [
          {
              text: 'Name',
              width: 100,
              sortable: false,
              hideable: false,
              dataIndex: 'name'
          },
          {
              text: 'Email Address',
              width: 150,
              dataIndex: 'email',
              hidden: true
          },
          {
              text: 'Phone Number',
              flex: 1,
              dataIndex: 'phone'
          }
      ]
  }); 
    
});















 

 

 

 

Posted by 혜화초보
,




 



<html>

<head>

</head>


<script  language="javascript"  >


function init(){


  var today = new Date();

  today.setDate(today.getDate() + 30); //Date after 30 days

  var year = today.getFullYear();

  var month = today.getMonth() + 1;

  var day = today.getDate();

  var min = '';

  var sec = '';

  console.log( year + '-' + month + '-' + day );


  today = new Date();

  today.setDate(today.getDate() - 30); // Date before 30 days

  year = today.getFullYear();

  month = today.getMonth() + 1;

  day = today.getDate();  

  console.log( year + '-' + month + '-' + day );

  

  today = new Date();  

  today.setMinutes(today.getMinutes() + 30); //After 30 minutes

  year = today.getFullYear();

  month = today.getMonth() + 1;

  day = today.getDate();    

  min = today.getMinutes();  

  console.log( year + '-' + month + '-' + day + '-' + min );  


  today = new Date();

  year = today.getFullYear();

  month = today.getMonth() + 1;

  day = today.getDate();   

  min = today.getMinutes();     

  sec = today.getSeconds();

  console.log( year + '-' + month + '-' + day + '-' + min + '-' + sec );

  

  today = new Date();

  year = today.getFullYear();

  month = today.getMonth() + 1;  

  min = today.getMinutes();      

  sec = today.setSeconds( today.getSeconds() + 500 );   //After 500 seconds

  sec = today.getSeconds();

  console.log( year + '-' + month + '-' + day + '-' + min + '-' + sec );


}


</script>

    <body  onload="init();" >

        <div id="groundDiv"  style="position:relative;"></div>

        <div id='a1'  style="position:absolute;" ></div>

        <input type='text'  size='20'       >

    </body>

</html>

 







'[.js] 날짜' 카테고리의 다른 글

날짜 빼기 , 11개월전 날짜 구하기  (0) 2018.11.21
현재날짜 YYYYMMDDHHMMSS  (0) 2018.10.05
현재 날짜 구하기  (0) 2017.09.06
이달의 마지막날짜 구하기  (0) 2017.09.06
Posted by 혜화초보
,