The sample should indicate that we should set the size for the gridstack be

The sample should indicate that we should set the size for the gridstack because when I was inspecting the element then size was showing 0.

gridStack.setSizeFull();

You are correct, I will improve examples. Thanks.