Author Topic: what is difference of initialize?  (Read 2233 times)

mrha

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 5
    • View Profile
what is difference of initialize?
« on: March 26, 2019, 12:02:42 pm »
grid appear gray mask about 6 by 4 rectangle when i click cell.
i lost too many my time. To figure out what the problem is.

you cast test array.htm in zip file.

good working case
Code: [Select]
$(function () {

      $("#grid_array").pqGrid( obj );
});

bad working case
Code: [Select]
      $("#grid_array").pqGrid( obj );


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6296
    • View Profile
Re: what is difference of initialize?
« Reply #1 on: March 26, 2019, 10:43:03 pm »
This one is the correct one.

Code: [Select]
//shorthand for document.ready event
$(function () {

      $("#grid_array").pqGrid( obj );
});

because elements are present in the DOM only when document is fully loaded in the browser i.e., document.ready event.

mrha

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: what is difference of initialize?
« Reply #2 on: March 27, 2019, 05:55:43 am »
thanks.  :)