jQWidgets Forums

jQuery UI Widgets Forums Grid jqxGrid is broken after calling the getstate method

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • Yuri Antipin
    Participant

    Hi!

    If the getstate method will be invoked in the beforeprocessing method then the jqxGrid control will be broken.

    Example:

    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="utf-8" />
            <title> </title>
            <link rel="stylesheet" href="styles/jqx.base.css"/>
            <script type="text/javascript" src="scripts/jquery-1.10.2.min.js"> </script>
            <script type="text/javascript" src="scripts/jqx-all.js"> </script>
            <script type="text/javascript">
                $(document).ready(function () {
    				var source =
    				{
    					datatype: "jsonp",
    					datafields: [
    						{ name: 'countryName', type: 'string' },
    						{ name: 'name', type: 'string' },
    						{ name: 'population', type: 'float' },
    						{ name: 'continentCode', type: 'string' }
    					],
    					url: "http://ws.geonames.org/searchJSON",
    					beforeprocessing: function() {
    						var state = $('#grid').jqxGrid('getstate');
    					}
    				};
    				var dataAdapter = new $.jqx.dataAdapter(source);
    				$('#grid').jqxGrid({
    					source: dataAdapter,
    					columns: [
    						{ text: 'Country', dataField: 'countryName', width: '50%' },
    						{ text: 'City', dataField: 'name', width: '50%' }
    					]
    				});
                });
            </script>
        </head>
        <body>
    		<div id="grid"></div>
        </body>
    </html>

    Best regards, Yuri Antipin.


    Peter Stoev
    Keymaster

    Hi Yuri Antipin,

    You should not call a method/property before constructing the Grid. “beforeprocessing” is called before the Grid is created and ready for usage.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.