1. #1
    Developer... jon.whitcraft's Avatar
    Join Date
    Mar 2007
    Posts
    391
    Vote Rating
    0
    jon.whitcraft is on a distinguished road

      0  

    Default ext.View and ext.JSONView

    ext.View and ext.JSONView


    i am using the JSONView component to make an image organizer, but i wanted to be able to select the thumbnails much like you can in windows where you can drag and you get a box that will select multiple when the box is over them.

    So I desided to write one. It's still really rough and i dont have any events in it yet but it you click, hold down, and move your mouse it will draw the box.

    http://dev2.indycar.com/online/jon/s.../selector.html

    Let me know what you think. Any and all ideas are welcome.

    Thanks

    Jon

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    10
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    wow, looks really great

  3. #3
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    That does look nice. Have you figured out how you will decide what you are over?

  4. #4
    Developer... jon.whitcraft's Avatar
    Join Date
    Mar 2007
    Posts
    391
    Vote Rating
    0
    jon.whitcraft is on a distinguished road

      0  

    Default


    No I have not yet. I'm going to work on that a bit today. I am thinking that when this is created it will have to know which view to use so a config option is going to have to be the view object or this is going to have to be put into the view somehow. I haven't looked into the view code too much but i'm sure there is a way i can do that.

    I do have it so that if you hold down ctrl or shift you get an icon so that you can add to your selection or select a different range again kinda of like windows. I need to put in the mac support but i'll get to that soon.

  5. #5
    Ext User bahar's Avatar
    Join Date
    Apr 2007
    Posts
    32
    Vote Rating
    0
    bahar is on a distinguished road

      0  

    Default


    very cool. have you combined it with the view yet?

  6. #6
    Sencha User
    Join Date
    Mar 2007
    Location
    Austria
    Posts
    118
    Vote Rating
    1
    Carina is on a distinguished road

      0  

    Default


    Wow, would be really nice to get this working. Are there any updates on this?
    Unfortunately, I haven't found any other threads on this topic.

    I would love to implement this myself but I have absolutely no idea how to figure out which items to select

  7. #7
    Ext User bahar's Avatar
    Join Date
    Apr 2007
    Posts
    32
    Vote Rating
    0
    bahar is on a distinguished road

      0  

    Default


    I think one way to find out which items are selected is by using getNodes() method of the view.
    getNodes() returns a list of template nodes, we can check these nodes one by one and see if they are under the rectangle and select them.
    I don't know if this is really applicable or the best way to do this but I think it may work.

  8. #8
    Sencha User
    Join Date
    Mar 2007
    Location
    Austria
    Posts
    118
    Vote Rating
    1
    Carina is on a distinguished road

      0  

    Default


    I tried to update this example to Ext but I'm having troubles with the event handling: I constantly get "too much recursion" errors for the mousedown event.

    Firebug:
    too much recursion
    [Break on this error] var args = Array.prototype.slice.call(arguments, 0);
    ext-all-debug.js (line 1418)

    too much recursion
    [Break on this error] if(this.browserEvent.type == 'mousedown')
    ext-all-debug.js (line 1858)

    too much recursion
    [Break on this error] if(l.fireFn.apply(l.scope, arguments) === false){
    ext-all-debug.js (line 1421)
    And the call stack looks like this:
    fire < stopPropagation < h < fire < stopPropagation < h < fire < stopPropagation < h ... and so on.

    I searched on the forum and the only thing I found out is that this could be caused by an event which causes itself to be fired again (well, obviously). But I have no idea why this happens. Tried a couple of things (using "addListener" or "on" with {stopPropagation: true, preventDefault: true} instead of "mon" and not explicitly using e.stopPropagation) but without success.


    Didn't make any changes to the code except for renaming Yahoo.Ext and getEl.
    I'm using ext 1.0.1.

  9. #9
    Sencha User ludoo's Avatar
    Join Date
    Mar 2007
    Location
    France, Luxembourg
    Posts
    60
    Vote Rating
    2
    ludoo is on a distinguished road

      0  

    Question Selectables

    Selectables


    And what about the "Selectables" from interface (based on jquery) ?

  10. #10
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    So you're wanting to select Element inside an area defined by a mousedown/drag?

    First, you should constrain the drag to within the container that contains selectable items.

    If you have the coordinates, you can create a YAHOO.util.Dom.Region (See docs).

    Then loop through the selectable items, get their Region, and see if the select Region contains the selectable item's Region using the Region.contains() method. If the selectable item is contained in that region, add it to the Array of selected items, add a "selected" class to it to highlight it.

    Well, that's the idea.

Similar Threads

  1. Paged JsonView+
    By reignman in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 25 Feb 2007, 5:50 AM
  2. View and JsonView UML
    By BernardChhun in forum Community Discussion
    Replies: 3
    Last Post: 10 Feb 2007, 9:13 AM
  3. Jsonview probleme
    By alex1er in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 15 Jan 2007, 7:38 AM
  4. Problems with JsonView
    By knagurski in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 22 Dec 2006, 11:13 AM
  5. Paginated JsonView how to?
    By moedusa in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 20 Dec 2006, 9:14 PM

Thread Participants: 10