EasyUI Forum
March 28, 2024, 10:07:50 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: 1 ... 8 9 [10]
 91 
 on: July 19, 2023, 04:43:39 AM 
Started by larryclyons - Last post by fmdano
Hey guys,
working with Larry on this and in our Grid we put in the code above, but the refreshRow code does not seem to work.


$('#ourGridName').treegrid({
         url:'com/Administration.cfc?method=getWhatWeNeed',
         method:'get',
         width:'97%',
         idField:'id',
         treeField:'col0',
         emptyMsg: "No Records Found",
         border: true,
         fit: true,
         singleSelect:true,
         checkOnSelect: true,
         fitColumns: true,
         striped: true,
         rownumbers: false,
         collapsible: true,
         lines: true,

         onClickCell: function(field,row,index){

            row['style'] = row['style']||{};
               console.log(row);
               console.log('row id: ' + row['id']);
               console.log('row style field: ' + row['style'][field]);
               alert(row['id']);
               alert(row['style'][field]);
               if (row['style'][field] == 'background:red;color:#fff'){
                        row['style'][field] = 'background:green;color:#fff';
               } else if (row['style'][field] == 'background:green;color:#fff'){
                  row['style'][field] = 'background:red;color:#fff';
               } else {
                  row['style'][field] = 'background:red;color:#fff';
               }
               alert(row['style'][field]);
         
               $(this).treegrid('refreshRow',row['id'])      

         },

         columns:[[  --- all our colum names and attributes below

The JSON that comes back from our external function is the same as what you have in the post, like:
var data =  [
   {  "id": 1, "name": "All Tasks", "begin": "3/4/2010", "end": "3/20/2010", "progress": 60, "iconCls": "icon-ok", "idField": 10 },
   { "idField": 11, "id": 2, "name": "Designing", "begin": "3/4/2010", "end": "3/10/2010", "progress": 100, "_parentId": 1, "state": "closed" },  and more..

MY QUESTION:
   in the refreshRow line above, when we use row['id'] which is in the idField attribute, what is that ID Field and how does it work with the refreshRow code? we have an id field in our json code that returns.
That is my guess as to why our code is not working but your example code works....ANY THOUGHTS that could help us more forward would be awesome.
thanks
Dan

 92 
 on: July 18, 2023, 11:32:04 PM 
Started by Wojak - Last post by jarry
This code works fine.
Code:
<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>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>
  <script type="text/javascript" src="https://www.jeasyui.com/easyui/datagrid-dnd.js"></script>
  <script>
    var data = [
      { "text": "Epson WorkForce 845", "group": "Printer" },
      { "text": "Canon PIXMA MG5320", "group": "Printer" },
      { "text": "HP Deskjet 1000 Printer", "group": "Printer" },
      { "text": "Cisco RV110W-A-NA-K9", "group": "Firewall" },
      { "text": "ZyXEL ZyWALL USG50", "group": "Firewall" },
      { "text": "NETGEAR FVS318", "group": "Firewall" },
      { "text": "Logitech Keyboard K120", "group": "Keyboard" },
      { "text": "Microsoft Natural Ergonomic Keyboard 4000", "group": "Keyboard" },
      { "text": "Logitech Wireless Touch Keyboard K400", "group": "Keyboard" },
      { "text": "Logitech Gaming Keyboard G110", "group": "Keyboard" },
      { "text": "Nikon COOLPIX L26 16.1 MP", "group": "Camera" },
      { "text": "Canon PowerShot A1300", "group": "Camera" },
      { "text": "Canon PowerShot A2300", "group": "Camera" }
    ]
    $(function () {
      $('#dl').datalist({
        data: data,
        onLoadSuccess: function () {
          $(this).datagrid('enableDnd');
        }
      });
    })
  </script>
</head>

<body>
  <div id="dl" title="DataList" style="width:400px;height:250px">
  </div>
</body>

</html>

 93 
 on: July 17, 2023, 03:34:13 PM 
Started by Wojak - Last post by Wojak
Hi,
Am having a problem w drag and drop on my Datagrid
Code:
Uncaught TypeError: Cannot read properties of undefined (reading 'jQuery3310090322002266437942')
    at Q.get (jquery.min.js:2:32502)
    at Q.access (jquery.min.js:2:32622)
    at Function.data (jquery.min.js:2:33477)
    at Object.options (jquery.easyui.min.js:12493:12)
    at $.fn.datagrid (jquery.easyui.min.js:12356:35)
    at getDraggingRow (datagrid-dnd.js:390:27)
    at HTMLTableRowElement.onBeforeDrag (datagrid-dnd.js:152:25)
    at HTMLTableRowElement.<anonymous> (jquery.easyui.min.js:638:21)
    at HTMLTableRowElement.dispatch (jquery.min.js:2:41772)
    at y.handle (jquery.min.js:2:39791)

And also is there a way to import drag and drop to datalist?

 94 
 on: July 17, 2023, 12:50:43 PM 
Started by larryclyons - Last post by larryclyons
Thanks Jarry. I'll give that a shot and let you know how it goes.

 95 
 on: July 17, 2023, 11:00:02 AM 
Started by Wojak - Last post by Wojak
Code:
inputEvents: {
            keydown: function (e) {
                if (e.keyCode === 9) {
                    e.preventDefault();
                    const val = this.value, start = this.selectionStart, end = this.selectionEnd;
                    this.value = val.substring(0, start) + '\t' + val.substring(end);
                    this.selectionStart = this.selectionEnd = start + 1;
                }
            }
        }

 96 
 on: July 15, 2023, 12:02:04 PM 
Started by Wojak - Last post by Wojak
Hi,
How can I disable moving to next input field in form by clicking tab and making '\t' in text field.

 97 
 on: July 15, 2023, 11:52:47 AM 
Started by Wojak - Last post by Wojak
Maybe there is a bug in my function?

Code:
function saveInfo() {
    if (!($('#form').form('validate'))) {
        return;
    }
    const formData = $('#form').serializeArray();
    if (fieldIdx >= 0) {
        const clickedField = $('#datalist').datalist('getRows')[fieldIdx];
        formData.forEach(e => {
            clickedField[e.name] = e.value;
        });
        $('#datalist').datalist('updateRow', { index: fieldIdx, row: clickedField }).datalist('refreshRow', fieldIdx);
    }
    $('#win').window('close');
}

 98 
 on: July 15, 2023, 09:25:39 AM 
Started by MSAG - Last post by MSAG
Hi
is there way to change grid view to Icons View like file explorer
something like cardview but multi card by width of grid

thanks a lot

 99 
 on: July 11, 2023, 08:05:37 AM 
Started by shivavalkyre - Last post by shivavalkyre
Hi,

is there any sample button group click?

best regrads

 100 
 on: July 01, 2023, 01:12:31 AM 
Started by poeziafree - Last post by jarry
The 'showEvent' property is available now. Please update to the latest version.

Pages: 1 ... 8 9 [10]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!