EasyUI Forum
April 27, 2024, 05:00:17 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [SOLVED] $('#A').layout({'add','collapsed:true'}); error  (Read 1521 times)
Coder
Jr. Member
**
Posts: 94


View Profile
« on: April 24, 2022, 03:30:20 PM »

Code:
  $('#A .main').layout(); 

  $('#A .main').layout('add',{
     region: 'east'
    //,noheader: true
    ,title: 'Instruction:'      
    ,hideCollapsedContent: false  
    ,border: false
    ,split: false
    ,collapsible:true
    ,collapsed:true
    ,width: '95%'
    ,content: '<input class="Instruction">'
  });

Quote
jquery.js:4094 Uncaught TypeError: Cannot read properties of undefined (reading 'jQuery321056324004689852392')
    at Data.get (jquery.js:4094:9)
    at Data.access (jquery.js:4112:16)
    at Function.data (jquery.js:4252:19)
    at Object.options (<anonymous>:3481:10)
    at jQuery.fn.init.$.fn.panel (<anonymous>:3453:32)
    at _3fb (<anonymous>:5584:22)
    at _3f1 (<anonymous>:5537:10)
    at HTMLDivElement.<anonymous> (<anonymous>:5743:1)
    at Function.each (jquery.js:362:19)
    at jQuery.fn.init.each (jquery.js:157:17)


without     ,collapsed:true all work fine
except that the panel is visible Smiley
« Last Edit: April 24, 2022, 04:47:03 PM by Coder » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: April 24, 2022, 04:41:36 PM »

Please look at this code. It works fine.
Code:
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Layout - jQuery EasyUI Demo</title>
  <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
  <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
  <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.min.js"></script>
  <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
</head>
<body>
  <div id="cc" style="width:700px;height:350px;">
    <div data-options="region:'center',title:'Center'"></div>
  </div>
  <script type="text/javascript">
    $(function(){
      $('#cc').layout();
      $('#cc').layout('add',{
         region: 'east'
        //,noheader: true
        ,title: 'Instruction:'       
        ,hideCollapsedContent: false 
        ,border: false
        ,split: false
        ,collapsible:true
        ,collapsed:true
        ,width: '50%'
        ,content: '<input class="Instruction">'
      });
    })
  </script>
</body>
</html>
Logged
Coder
Jr. Member
**
Posts: 94


View Profile
« Reply #2 on: April 24, 2022, 04:49:16 PM »

added

Code:
  $('#A .main').layout('add',{   region: 'center' , ... });

before

Code:
  $('#A .main').layout('add',{  region: 'east' , ... });

fixed my problem.

Thank You very much!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!