use local array named "defaultData" to store data in case user not pass an array to grid
swap position of 2 funcs