jQWidgets Forums

jQuery UI Widgets Forums Grid Can’t hide column in ready callback

This topic contains 2 replies, has 2 voices, and was last updated by  egoriy 11 years, 12 months ago.

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

  • egoriy
    Member

    I cannot hide column no way
    My code:
    <link rel=”stylesheet” href=”/css/jqx.base.css” type=”text/css” />
    <link rel=”stylesheet” href=”/css/jqx.classic.css” type=”text/css” />
    <script type=”text/javascript” src=”/js/jqwidgets/jqxcore.js”></script>
    <script type=”text/javascript” src=”/js/jqwidgets/jqxdata.js”></script>
    <script type=”text/javascript” src=”/js/jqwidgets/jqxbuttons.js”></script>
    <script type=”text/javascript” src=”/js/jqwidgets/jqxscrollbar.js”></script>
    <script type=”text/javascript” src=”/js/jqwidgets/jqxmenu.js”></script>
    <script type=”text/javascript” src=”/js/jqwidgets/jqxgrid.js”></script>
    <script type=”text/javascript” src=”/js/jqwidgets/jqxgrid.selection.js”></script>
    <script type=”text/javascript” src=”/js/jqwidgets/jqxgrid.columnsresize.js”></script>
    <script type=”text/javascript” src=”/js/jqwidgets/jqxgrid.columnsreorder.js”></script>
    <script type=”text/javascript” src=”/js/jqwidgets/jqxpanel.js”></script>
    <script type=”text/javascript”>

    $(document).ready(function(){
    var source ={
    datatype: “json”,
    datafields: [{ name: ‘num_str’ },{ name: ‘cur_status’ },{ name: ‘cur_event’ }],
    id: ‘cur_event’,
    url: ‘/gridinterfaceprocessing/’
    };

    var dataAdapter = new $.jqx.dataAdapter(source);

    $(“#jqxgrid”).jqxGrid({
    source: dataAdapter,
    selectionmode: ‘multiplerowsextended’,
    width: 490,
    theme: ‘classic’,
    columns: [{ text: ‘фонд/опись/дело’, datafield: ‘num_str’, width: 222 },{ text: ‘Текущий статус дела’, datafield: ‘cur_status’, width: 250 },{ text: ‘cur_event’, datafield: ‘cur_event’}],
    ready: function()
    {
    $(“#jqxGrid”).jqxGrid(‘hidecolumn’, ‘cur_event’);
    }
    });

    });

    </script>
    <div id=”jqxgrid”></div>

    But in spite of api examples
    column ‘cur_event’ never hides(the grid shows well with this column visible)
    Thank you in advance.


    Peter Stoev
    Keymaster

    Hi,

    The following line:

    $(“#jqxGrid”).jqxGrid(‘hidecolumn’, ‘cur_event’); 

    uses jqxGrid as ID. However, as far as I see, you initialize the Grid from ID=”jqxgrid”. That means that for calling methods and setting properties, you should use “jqxgrid”, too.

    $(“#jqxgrid”).jqxGrid(‘hidecolumn’, ‘cur_event’);

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    egoriy
    Member

    Yes, you are right.
    stupid mistake
    Thank you.

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

You must be logged in to reply to this topic.