35. Authorization
Client: âI need sellers to be able to login, tooâ
â...Oh, and donât let them change or delete
anythingâ
36. Authorization
Client: âI need sellers to be able to login, tooâ
â...Oh, and donât let them change or delete
anythingâ
Pro tip: treat your boss as your client
65. Netzke component
... is a Ruby class
class SimpleComponent < Netzke::Base
end
... along with the corresponding JS class
>> puts SimpleComponent.js_code
Ext.define('Netzke.classes.SimpleComponent', {
// ...
});
66. Instantiating in Ext JS
var c = Ext.create('Ext.panel.Panel', {
title: 'Hello',
width: 200,
height: 150,
html: '... world!',
bbar: [{text: 'Button'}]
});
67. Instantiating in Ext JS
var c = Ext.create('Ext.panel.Panel', {
title: 'Hello',
width: 200,
height: 150,
html: '... world!',
bbar: [{text: 'Button'}]
});
c.setTitle("Brave new");
68. Instantiating in Netzke
c = SimpleComponent.new(title: "Hello", html: "...world!")
>> pp c.js_config
{
:title=>"Hello",
:html=> "...world!"
}
78. Charts
# It knows we deal with multiple
# forecasts that have to be displayed class DayChart < ActivityChart
# with colored lines, but it's flexible def data
# about what to display along the axes # query data for given day
# (which is configurable) end
class ActivityChart < Netzke::Base end
js_base_class "Ext.chart.Chart"
class WeekChart < ActivityChart
# lots of code ...
def data
# query data for given week
# This data goes to the client
end
# via the constructor
def data end
[]
end
end