Search Results

Search found 2 results on 1 pages for 'ldk'.

Page 1/1 | 1 

  • Custom ListView Row, can no longer select rows...

    - by LDK
    Here's my ScrollView: middle: SC.ScrollView.design({ layout: { top: 36, bottom: 32, left: 0, right: 0 }, backgroundColor: '#ccc', contentView: SC.ListView.design({ contentBinding: 'Spanish.wordsController.arrangedObjects', selectionBinding: 'Spanish.wordsController.selection', contentValueKey: "word", contentDisplayProperties: 'word english'.w(), selectOnMouseDown: YES, exampleView: Spanish.CustomListItemView }) }) and here is my custom listView row: Spanish.CustomListItemView = SC.View.extend({ render: function(context, firstTime){ var content = this.get('content'); var word = content.get('word'); var english = content.get('english'); context = context.begin().push(' %@ (%@)'.fmt(word,english)).end(); return sc_super(); } }); The above works as expected, except that I can no longer select views. When I comment out "exampleView: Spanish.CustomListItemView" I can select rows, but they are no longer formatted properly. Why can I no longer select rows when I use exampleView?

    Read the article

  • Javascript: adding methods using prototype descriptor

    - by LDK
    Sorter.prototype.init_bubblesort = function(){ console.log(this.rect_array); this.end = this.rect_array.length; this.bubblesort(); } Sorter.prototype.init = function(array,sort_type){ this.rect_array = array; this.init_bubblesort(); } The code above works as expected, but when I change the init function to: Sorter.prototype.init = function(array,sort_type){ var sort_types = {'bubblesort':this.init_bubblesort, 'quicksort':this.init_quicksort, 'liamsort':this.init_liamsort}; this.rect_array = array; sort_types[sort_type](); } the init_bubblesort function results in an error saying this.rect_array is undefined. I'm trying to wrap my head around why init_bubblesort no longer as access to it's instance's variables.

    Read the article

1