How to prevent an item from being opened

clock September 28, 2015 15:09 by author htmltreegrid

Question

Is there way I can cancel an expand or collapse icon click based on a condition ? We need to stop a user from expanding or collapsing the grid based on value.


Answer:

Sure, please use the itemOpening event.



flexiciousNmsp.onItemOpening=function(evt){
    
alert('Sorry, cant open');
    evt.preventDefault
();
    evt.cell
.refreshCell();
};
$(document).ready(function () {
    
var grid = new flexiciousNmsp.FlexDataGrid(document.getElementById("gridContainer"),
            {

                
configuration:'<grid id="grid" enableDynamicLevels="true" itemOpening="flexiciousNmsp.onItemOpening" >' +
                        
'        <level  enableFooters="true" ' +
                        
'   childrenField="children">' +



Full example below

 

 

InnerLevelWrapText.html (5.20 kb)



How to change the base images path

clock September 23, 2015 14:02 by author htmltreegrid

Question:

I noticed there is a hardcoded path to some images in the minified JS – this is causing the pager bar buttons to have no images.  

OR 

Where can I customize the path used by the images in the toolbar?

Answer:

Please set value of 

flexiciousNmsp.Constants.IMAGE_PATH to the folder you have stored all the images in.

For example

flexiciousNmsp.Constants.IMAGE_PATH="
http://www.htmltreegrid.com/demo/flexicious/css/images/ ";

 

Its important to set this in the right place. The ideal place to set this is after the minified-compiled-jquery script but BEFORE the themes.js file:Something like this

<script type="text/javascript" src="http://www.htmltreegrid.com/demo/examples/js/Configuration.js"></script>
<script type="text/javascript">
flexiciousNmsp.Constants.IMAGE_PATH="http://www.flexdatagrid.com/htmlgrid/htmlcomponents/flexicious/css/flexicious/images";
</script>
<script type="text/javascript" src="http://www.htmltreegrid.com/demo/themes.js"></script>

Below is the complete text case

TwoGrids.html (4.39 kb)