Check if the selected item is a folder or an Item EcmaScript Client Object model sharepoint 2010
To check if the selected item is a File or a Folder you can use the EnableScript tag and get the item content type.
See how to use EnableScript@ Enable\Disable Ribbon button by Users Group Sharepoint 2010
The code line that you would use to check if its a File or a Folder is
selectedItem.get_fileSystemObjectType();
The above will return an object of type File or Folder which you can further use to enable of disable the ribbon button or show your user's an alert message to select a file only.
Ref - http://msdn.microsoft.com/en-us/library/ee548025.aspx
See how to use EnableScript@ Enable\Disable Ribbon button by Users Group Sharepoint 2010
The code line that you would use to check if its a File or a Folder is
selectedItem.get_fileSystemObjectType();
The above will return an object of type File or Folder which you can further use to enable of disable the ribbon button or show your user's an alert message to select a file only.
Ref - http://msdn.microsoft.com/en-us/library/ee548025.aspx
0 comments:
Post a Comment