0
votes

I'm trying to understand the flexigrid at FlexiGrid

At line # 1161 & 1163 I dint understand the jQuery selectors: $('div',g.pDiv).html(html); & $('.pReload',g.pDiv).click(function(){g.populate()}); But these doesn't look like the multiple selectors, Please suggest me to understand this code.

                $('div',g.pDiv).html(html);

            $('.pReload',g.pDiv).click(function(){g.populate()});

Regards

1

1 Answers

1
votes

The second argument to $(selector, context) is the context to look inside of for that selector, so this:

$('div',g.pDiv).html(html);

Is really:

$(g.pDiv).find('div').html(html);

...so it's looking for <div> elements inside that stored g.Div element the plugin saves a reference to.