Revisions

  • a1229d mattcol... Thu Aug 28 20:46:39 -0700 2008
  • 609994 mattcol... Thu Aug 28 20:23:03 -0700 2008
  • 7d392d mattcol... Thu Aug 28 20:18:39 -0700 2008
  • 55d9dc mattcol... Thu Aug 28 20:03:33 -0700 2008
  • 258e34 mattcol... Thu Aug 28 19:58:46 -0700 2008
  • 56088a mattcol... Thu Aug 28 19:56:48 -0700 2008
  • f69fda mattcol... Thu Aug 28 19:30:46 -0700 2008
gist: 7883 Download_button fork
public
Description:
SC custom test view
Public Clone URL: git://gist.github.com/7883.git
body.rhtml
1
2
3
    <%= view :test_view, :view => 'Admin.TestView',
    :bind => {:value => 'Admin.masterController.test'} %>
 
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// ==========================================================================
// Admin.TestView
// ==========================================================================
 
require('core');
require('views/label');
require('views/view');
require('mixins/delegate_support');
 
/** @class
 
(Document Your View Here)
 
@extends SC.View
@author AuthorName
@version 0.1
*/
Admin.TestView = SC.View.extend(SC.DelegateSupport,
/** @scope Admin.TestView.prototype */ {
 
  emptyElement: '<span class="cell-label"></span>',
 
value: 'work please',
 
  render: function() {
    var html = [];
var value = this.get('value');
 
    var cellLabel = this.outlet('cellLabel');
 
    cellLabel.set('value', value);
 
    // the newlines and spaces are for well formatted html
html.push('<span class="cell-label"></span>');
 
    // Finally set the innerHTML of the view
    html = html.join('');
    this.set('innerHTML', html);
  }.observes('value'),
 
  /** @private */
  cellLabel: SC.LabelView.extend({
 
   isEditable: YES,
 
  }).outletFor('.cell-label?'),
 
}) ;