-
-
Save princeppy/a90ab87ede40a5e82e34f2f83a7a28e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function(){ | |
| var scriptbase = _spPageContextInfo.webServerRelativeUrl + "_layouts/15/"; | |
| $.getScript(scriptbase + "SP.Runtime.js", | |
| function () { | |
| $.getScript(scriptbase + "SP.js", function(){ | |
| $.getScript(scriptbase + "SP.Taxonomy.js", execOperation); | |
| }); | |
| } | |
| ); | |
| }); | |
| function execOperation(){ | |
| var context = SP.ClientContext.get_current(); | |
| var list = context.get_web().get_lists().getByTitle('TaxonomyCustomList'); | |
| var listItem = list.getItemById(1); | |
| context.load(listItem); | |
| context.executeQueryAsync(function(){ | |
| //Single Value Taxonomy Column | |
| //Label | |
| var label = listItem.get_item("MyTaxColumn").get_label(); | |
| //Term GUID | |
| var termGUID = listItem.get_item("MyTaxColumn").get_termGuid(); | |
| //Type ID | |
| var typeID = listItem.get_item("MyTaxColumn").get_typeId(); | |
| //WSS ID | |
| var wssID = listItem.get_item("MyTaxColumn").get_wssId(); | |
| },function(sender,args){ | |
| console.log(args.get_message()); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment