.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.dataview.DataViewIndexListModel:

==========================================================================================================================================
|phoenix_title|  **wx.dataview.DataViewIndexListModel**
==========================================================================================================================================

:ref:`wx.dataview.DataViewIndexListModel`  is a specialized data model which lets you address an item by its position (row) rather than its :ref:`wx.dataview.DataViewItem`  (which you can obtain from this class).          

This model also provides its own :meth:`wx.dataview.DataViewIndexListModel.Compare`   method which sorts the model's data by the index. 

This model is not a virtual model since the control stores each :ref:`wx.dataview.DataViewItem`. Use :ref:`wx.dataview.DataViewVirtualListModel`  if you need to display millions of items or have other reason to use a virtual control. 









.. seealso:: :ref:`wx.dataview.DataViewListModel`  for the API.  







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>DataViewIndexListModel</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.dataview.DataViewIndexListModel_inheritance.png" alt="Inheritance diagram of DataViewIndexListModel" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.RefCounter.html" title="wx.RefCounter" alt="" coords="76,5,187,35"/> <area shape="rect" id="node3" href="wx.dataview.DataViewModel.html" title="wx.dataview.DataViewModel" alt="" coords="33,83,231,112"/> <area shape="rect" id="node2" href="wx.dataview.DataViewListModel.html" title="wx.dataview.DataViewListModel" alt="" coords="21,160,243,189"/> <area shape="rect" id="node4" href="wx.dataview.DataViewIndexListModel.html" title="wx.dataview.DataViewIndexListModel" alt="" coords="5,237,259,267"/> </map> 
   </p>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.dataview.DataViewListStore`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.dataview.DataViewIndexListModel.__init__`                             Constructor.
:meth:`~wx.dataview.DataViewIndexListModel.GetItem`                              Returns the :ref:`wx.dataview.DataViewItem`  at the given `row`.
:meth:`~wx.dataview.DataViewIndexListModel.Reset`                                Call this after if the data has to be read again from the model.
:meth:`~wx.dataview.DataViewIndexListModel.RowAppended`                          Call this after a row has been appended to the model.
:meth:`~wx.dataview.DataViewIndexListModel.RowChanged`                           Call this after a row has been changed.
:meth:`~wx.dataview.DataViewIndexListModel.RowDeleted`                           Call this after a row has been deleted.
:meth:`~wx.dataview.DataViewIndexListModel.RowInserted`                          Call this after a row has been inserted at the given position.
:meth:`~wx.dataview.DataViewIndexListModel.RowPrepended`                         Call this after a row has been prepended to the model.
:meth:`~wx.dataview.DataViewIndexListModel.RowValueChanged`                      Call this after a value has been changed.
:meth:`~wx.dataview.DataViewIndexListModel.RowsDeleted`                          Call this after rows have been deleted.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.dataview.DataViewIndexListModel(DataViewListModel)

   **Possible constructors**::

       DataViewIndexListModel(initial_size=0)
       
   
   DataViewIndexListModel is a specialized data model which lets you
   address an item by its position (row) rather than its DataViewItem
   (which you can obtain from this class).



   .. method:: __init__(self, initial_size=0)

      Constructor.                  


      :param `initial_size`: 
      :type `initial_size`: int







   .. method:: GetItem(self, row)

      Returns the :ref:`wx.dataview.DataViewItem`  at the given `row`.                  


      :param `row`: 
      :type `row`: int




      :rtype: :ref:`wx.dataview.DataViewItem`








   .. method:: Reset(self, new_size)

      Call this after if the data has to be read again from the model.                  

      This is useful after major changes when calling the methods below (possibly thousands of times) doesn't make sense.                  


      :param `new_size`: 
      :type `new_size`: int







   .. method:: RowAppended(self)

      Call this after a row has been appended to the model.                   





   .. method:: RowChanged(self, row)

      Call this after a row has been changed.                  


      :param `row`: 
      :type `row`: int







   .. method:: RowDeleted(self, row)

      Call this after a row has been deleted.                  


      :param `row`: 
      :type `row`: int







   .. method:: RowInserted(self, before)

      Call this after a row has been inserted at the given position.                  


      :param `before`: 
      :type `before`: int







   .. method:: RowPrepended(self)

      Call this after a row has been prepended to the model.                   





   .. method:: RowValueChanged(self, row, col)

      Call this after a value has been changed.                  


      :param `row`: 
      :type `row`: int
      :param `col`: 
      :type `col`: int







   .. method:: RowsDeleted(self, rows)

      Call this after rows have been deleted.                  

      The array will internally get copied and sorted in descending order so that the rows with the highest position will be deleted first.                  


      :param `rows`: 
      :type `rows`: list of integers






