Results 1 to 3 of 3

Thread: Trying to use canvas in a Ext.dataView

  1. #1

    Default Trying to use canvas in a Ext.dataView

    Hello!!
    I'm trying to use canvas to draw a background inside a Ext.dataView which uses an store and a xtemplate for draw some objects. But I'm having some problems:

    • I can't find and event which fires after the xTemplate have rendered the objects and dataView has shown them.
    • This part concernd only html/css but I don't know how to adjust the size of the canvas element to be under all the objects which I have created with the xtemplate (Note: I am using boxes which exceed the size so It uses the overflow)

    Thank you, and If you don't undertand what I am asking, say it.

    Enrique

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    There is no event, so you'll have to do an inline override.

    Is the data in the store static (add, update and delete events cause a dataview to change)?

    If it displays static data you can override the 'refresh' method, otherwise I would recommend overriding the 'updateIndexes', because it is called after every change.

    Example:
    Code:
    var dataview = new Ext.DataView({
      ...
      refresh: function(){
        this.constructor.prototype.refresh.call(this);
        // all the items are now rendered
      }
    });

  3. #3

    Default

    Thank you, very much, I have done it in that way but I was looking for a way in which I didn't need to override that method, but It works, thanks. Now I am havingo so much trouble trying to complete the step 2, making the canvas to adjust to the parent div, includind the overflow, I mean that the canvas image scroll with the scroll without need to specify the width and height.

    Thank you
    Enrique

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •