Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8689131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:33:50+00:00 2026-06-12T23:33:50+00:00

I am using jQuery Easy UI in my website. I need treegrid in a

  • 0

I am using “jQuery Easy UI” in my website. I need treegrid in a page with checkbox for each row (The same way as “jQuery Easy UI”-tree provedes).

jQuery Easy UI tree with checkbox screen-shot

I needs the same tree to be appear with grid in treegrid widget, instead of

jQuery Easy UI treegrid screen-shot

Any suggestion is most welcome….

thanks….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:33:51+00:00Added an answer on June 12, 2026 at 11:33 pm

    add the following code to have checkbox column to your tree table

    $(function() {
    
    columns:[[  
                {field:'code',title:'Code',width:100,align:'left'},
                    {field:'name',title:'Name',width:100,align:'right'},  
                    {field:'addr',title:'choose',width:80},  
                    {field:'col4',title:'col4',width: 100, 
                        editor: {
                            type: 'checkbox', 
                            options: {on: '1', off: '0'}
                        }, 
                        formatter: function (value, row) { 
                            if (! row.leaf) { 
                                if (value == 1) { 
                                    return '<img src="../resources/image/checked.jpg"/>'; 
                                } else { 
                                    return '<img src="../resources/image/unchecked.jpg"/>'; 
                                } 
                            } else { 
                                return''; 
                            } 
                        }
                    } 
                  ]], 
    
                //Edit the end of the line, 
                // use click event first perform onAfterEdit event before the event trigger
                onClickRow: function (row) { 
                    var rowIndex = row.id; 
                    if (lastIndex != rowIndex) { 
                        $('#tablegridJS').treegrid('endEdit', lastIndex); 
                    } 
                 }, 
                 //Line editing, 
                 //use double-click event
                 onDblClickRow: function (row) { 
                 var rowIndex = row.id; 
                     if (lastIndex != rowIndex) { 
                         $('#tablegridJS').treegrid('endEdit', lastIndex); 
                         $('#tablegridJS').treegrid('beginEdit', rowIndex); 
                         lastIndex = rowIndex; 
                     } 
                 }, 
    
                OnBeforeEdit: function (row) { 
                    console.log(row);
                    beforEditRow(row); // Here are the main steps and code functions 
                },
    
                OnAfterEdit: function (row, changes) { 
                    console.log(change);
                    var rowId = row.id; 
                        $.ajax ({ 
                        url: "saveProductConfig.action", 
                        data: row, 
                        success: function (text) { 
                            $.Messager.alert ('message', 'text', 'info'); 
                        }
                    }); 
                },
                onClickCell: function(field, row) {
                    if(field=='col4'){
                         var rowIndex = row.id; 
                         if (lastIndex != rowIndex) { 
                             $('#tablegridJS').treegrid('endEdit', lastIndex); 
                             $('#tablegridJS').treegrid('beginEdit', rowIndex); 
                             console.log($('#tablegridJS').treegrid('options')); 
                             options = $('#tablegridJS').treegrid('getEditor',{
                                    index:row.id,    // pass the editing row id, defined via 'idField' property
                                    field:'col4'
                                });
                             //console.log($(options.target).attr('checked',true));
                             console.log(options.target);
                             if(options.oldHtml=='<img src="../resources/image/unchecked.jpg">'){
                                 $(options.target).attr('checked',true);
                             }else if(options.oldHtml=='<img src="../resources/image/checked.jpg">'){
                                 $(options.target).attr('checked',false);
                             }
                             lastIndex = rowIndex; 
                         } 
                    }           
                }
            });  
    
             function beforEditRow (row) { // This is the core, very useful if the same needs, then you can learn to achieve 
                //check box
                var libraryCoclum = $('#tablegridJS').treegrid('getColumnOption', 'col4'); 
    
    
                //checkbox object
                var checkboxOptionsObj = new Object (); 
                checkboxOptionsObj.on = '1 '; 
                checkboxOptionsObj.off = '0 '; 
                //add checkbox object on edit
                var checkboxEditorObj = new Object (); 
                checkboxEditorObj.type = 'checkbox'; 
                checkboxEditorObj.options = checkboxOptionsObj; 
    
    
                //ckeck whether to make checkbox or combo box editable
                if (row.leaf) { 
                    libraryCoclum.editor = null; 
                    typeCoclum.editor = comboboxEditorObj; 
                } else { 
                    libraryCoclum.editor = checkboxEditorObj; 
                    typeCoclum.editor = null; 
                } 
            }
            $("#bteasyui").click(function(){
                var dataSelected = "";
                //$("#tablegridJS").treegrid('selectAll');
                nodes = $("#tablegridJS").treegrid('getSelection');
                console.log(nodes);
    
                $('#tablegridJS').treegrid('beginEdit', nodes.id);  
    
                dataSelected = $("#tablegridJS").treegrid("check",'01');
                console.log($("#tablegridJS").treegrid('getChecked'));
    
            });
        }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

got an easy question, using jquery, how do i create a menu, with links
It's very easy to copy a javascript object in jQuery using jQuery.extend() function call.
I feel like this is easy but I am missing something... Using jQuery, I
I'm using this jQuery urlencode and urldecode plugin - very simple and easy to
I've a little problem here.. I am using jquery easy UI to get data
I am creating an ajax website and I am using jquery's .load() to load
I am using Drupal 6 to build a website. I need to insert a
Sorry, I am still new using jquery so this might be an easy question.
I'm using this wonderful jquery plugin found here... http://appgrinders.github.com/jquery-easy-drop-down/ Only problem is, it doesn't
I'm using Jquery Easy Slider on Opencart v.1.5.1 http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider What I'm trying to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.