@astelcom

@astelcom

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Problem with RowMenuCommand #100737
    astelcom
    Member

    here are the two parts of grid initialization of the precedent post : as they have been reformatted by forum :
    http://filestore.astelcom.net/HtmlElements/gridInit1.txt
    http://filestore.astelcom.net/HtmlElements/gridInit2.txt
    Regards.

    in reply to: Problem with RowMenuCommand #100736
    astelcom
    Member

    Hello Peter,
    Thanks for this first answer.
    As a workaround, I tried to replace the row menu button by a link inside a grid column, but I experience issues while adding Events on these links !
    I tried several ways :
    In grid initialisation, I used a formatFunction inside the columns section , with the following code :

    {label: 'Action', width: '30px', cellsAlign: 'right', allowResize: false, align: 'right', dataField: 'Status', allowGroup: false,
       formatFunction(settings) {
          if (settings.value === 'Active') {
             settings.template = '<div></div>';
          } else {
             settings.template = '<div></div>';
          }
       }
    }

    With the following eventHandling after the grid load :

    	var oEnableItemList = document.querySelectorAll(".appenableitem");
    	oEnableItemList.forEach(function(item) {
    		item.addEventListener('click',function(event) {
    			console.log(event.target);
    		});
    	});
    	var oDisableItemList = document.querySelectorAll(".appdisableitem");
    	oDisableItemList.forEach(function(item) {
    		item.addEventListener('click',function(event) {
    			alert(event.target);
    		});
    	});
    

    Without any success : the DOMNodeLists of the querySelector are empty.
    Other way :

    {label: 'Action', width: '30px', cellsAlign: 'right', allowResize: false, align: 'right', dataField: 'Status', allowGroup: false,
       formatFunction(settings) {
          if (settings.value === 'Active') {
             settings.template = '<div></div>';
          } else {
             settings.template = '<div></div>';
          }
       }
    }

     
    With the following functions :

    function enableMyItem(element) {
    alert('enableItem');
    }
    function disableMyItem (element) {
    alert('disableItem');
    }
    

    ends with :
    ReferenceError : enableMyItem is undefined.
    ReferenceError : enableMyItem is undefined.
    Can you tell me where I’m wrong ? Did I miss something ?

Viewing 2 posts - 1 through 2 (of 2 total)