Comments (2)
Show me example, plz
from jquery-treegrid.
var rowIndex;
$( document ).ready( function ()
{
$( '.tree' ).treegrid( {
initialState: 'collapsed',
expanderExpandedClass: 'glyphicon glyphicon-minus',
expanderCollapsedClass: 'glyphicon glyphicon-plus'
} );
$( '#tblTree tr' ).bind( 'dblclick', function ( obj )
{
rowIndex = obj.currentTarget.sectionRowIndex;
var paramValues = [];
$( 'td', obj.currentTarget ).each( function ( d, e )
{
paramValues.push( e.innerText );
} );
$( '#divPopup' ).on( 'show.bs.modal', function ()
{
$( '#txtTask' ).val( paramValues[0] );
$( '#txtStatus' ).val( paramValues[1] );
$( '#txtAssigned' ).val( paramValues[2] );
} );
$( '#divPopup' ).modal( 'show' );
} );
} );
function SaveClick()
{
var returnValues = [];
returnValues.push( $( '#txtTask' ).val() );
returnValues.push( $( '#txtStatus' ).val() );
returnValues.push( $( '#txtAssigned' ).val() );
var selectedRow = $( '#tblTree tbody tr' )[rowIndex];
var i = 0;
$( 'td', selectedRow ).each( function ( d, e )
{
var oldValue = e.innerText;
$( 'td', selectedRow )[i].innerText.replace( oldValue, returnValues[i] );
i++;
} );
}
<form id="form1" runat="server">
<div>
<table id="tblTree" class="table tree table-bordered table-striped table-condensed">
<thead>
<tr style="text-align: center; background: #BBBAB8;">
<td>
Task Name
</td>
<td>
Status
</td>
<td>
Assigned To
</td>
</tr>
</thead>
<tbody>
<tr id="node-1" class="treegrid-1 treegrid-expanded" style="">
<td id="td-1">
<span class="treegrid-expander glyphicon glyphicon-minus"></span>Task Base
</td>
<td id="td-2">
Active
</td>
<td id="td-3">
Network
</td>
</tr>
<tr id="node-2" class="treegrid-2 treegrid-parent-1" style="display: none;">
<td id="txtTest">
<span class="treegrid-indent"></span><span class="treegrid-expander"></span>Sub Task1
</td>
<td id="txtTd">
Complete
</td>
<td>
Networks
</td>
</tr>
<tr class="treegrid-3 treegrid-parent-1 treegrid-expanded" style="display: none;">
<td>
<span class="treegrid-indent"></span><span class="treegrid-expander glyphicon-minus glyphicon"></span>Node 1-2
</td>
<td>
Close
</td>
<td>
Development
</td>
</tr>
..........
</tbody>
</table>
</div>
<div id="divPopup" class="modal" role="dialog" style="left: 200px; top: 100px;">
<div id="divPopUpContent" class="modal-content" style="width: 50%;">
<div id="divPopUpHeader" class="modal-header">
<span>List Of Task</span>
</div>
<div id="divPopUpBody" class="modal-body">
<div class="row">
<div class="col-lg-6">
<label for="s" class="screen-reader-text">
Task Name:</label>
</div>
<div class="col-lg-6">
<input type="text" id="txtTask" class="form-control" />
</div>
</div>
<br />
<div class="row">
<div class="col-lg-6">
<label for="s" class="screen-reader-text">
Status:</label>
</div>
<div class="col-lg-6">
<input type="text" id="txtStatus" class="form-control" />
</div>
</div>
<br />
<div class="row">
<div class="col-lg-6">
<label for="s" class="screen-reader-text">
Assigned To:</label>
</div>
<div class="col-lg-6">
<input type="text" id="txtAssigned" class="form-control" />
</div>
</div>
</div>
<div id="divPopUpFooter" class="modal-footer">
<button class="small-button green" onclick="SaveClick()">
Save</button>
</div>
</div>
</div>
</form>
from jquery-treegrid.
Related Issues (20)
- Still maintenance or not? HOT 2
- Nested treegrid
- load data by json HOT 1
- Add headers to the treegrid
- Issue with saveState HOT 1
- Can the plugin support ie8?
- Can Support a method reload?
- Bootstrap 4 compatibility?
- Need function on draw tree
- Css not applied to dynamically created treegrid
- Can support load children with ajax,when click expand icon?
- No Google jquery
- Treegrid not working with boostrap 4 and jquery 3+ HOT 7
- How to add new nodes under a node?
- Pagination issue
- Jquery treegrid plugin freezes when table contains more 2500 records (rows)
- Collapsed rows HOT 1
- treegrid problem for show element
- Slows when large amount of data HOT 1
- Long text breaks under icon instead left aligned with text HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-treegrid.