cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hardikv
Memorable Member
Memorable Member

SharePoint Document Location Subgrid "loaded" event in Basic Form

Hi,

 

I want to trigger loaded event in SharePoint Document Location Subgrid. I tried so many ways but didn't work.

 

Below code is working for other subgrid except SharePoint Document Location Subgrid.

 

//var entityGridDocument = $(".subgrid.sharepoint-grid").eq(0);
var entityGridDocument = $(".entity-grid.subgrid").eq(0); 
entityGridDocument.on("loaded", function () {
	entityGridDocument.find("table tbody > tr").each(function(index, tr) {
		if(myStatus == "1")
		{
			$(tr).find('.btn.btn-default.btn-xs').hide();
		}
	});	
});

 

Please suggest your thoughts!

1 ACCEPTED SOLUTION

Accepted Solutions
ErikLm
Frequent Visitor

Hi @hardikv 

 

I found a way of triggering "loaded" event in SharePoint Document Location Subgrid, it's a workaround but is works great. 

 

Found the answer here: https://stackoverflow.com/questions/15657686/jquery-event-detect-changes-to-the-html-text-of-a-div 

 

$(document).ready(function () {
    // Select the target node.
    var target = document.querySelector('.sharepoint-loading')

    // Create an observer instance.
    var observer = new MutationObserver(function(mutations) {
        //do stuff  
    });

    // Pass in the target node, as well as the observer options.
    observer.observe(target, {
        attributes:    true,
        childList:     true,
        characterData: true
    });
});

 

Hope it helps!

/ErikLm

View solution in original post

3 REPLIES 3
hardikv
Memorable Member
Memorable Member

Hi @v-bofeng-msft 

 

Can you please help me?

ErikLm
Frequent Visitor

Hi @hardikv 

 

I found a way of triggering "loaded" event in SharePoint Document Location Subgrid, it's a workaround but is works great. 

 

Found the answer here: https://stackoverflow.com/questions/15657686/jquery-event-detect-changes-to-the-html-text-of-a-div 

 

$(document).ready(function () {
    // Select the target node.
    var target = document.querySelector('.sharepoint-loading')

    // Create an observer instance.
    var observer = new MutationObserver(function(mutations) {
        //do stuff  
    });

    // Pass in the target node, as well as the observer options.
    observer.observe(target, {
        attributes:    true,
        childList:     true,
        characterData: true
    });
});

 

Hope it helps!

/ErikLm

ErikLm 

This codes work. Thank you .

 

Helpful resources

Announcements
Carousel Community Blog

Check out the Community Blog

Read all about the most recent blogs in the community!

Carousel News & Announcements

What's New in the Community?

Check out the latest News & Events in the community!

Users online (20,240)