小编lam*_*amu的帖子

JavaScript中的Bitwise XOR运算符

为什么是这样:

console.log("1100" ^ "0001")
=> 1101 // as expected

console.log("1100" ^ "1001")
=> 1957 // ???
Run Code Online (Sandbox Code Playgroud)

请解释.谢谢.

javascript bit-manipulation

8
推荐指数
1
解决办法
4071
查看次数

isLoaded用于ExtJS数据存储

这不是问题,但也许我可以帮助其他人使用该代码.

因为ExtJS商店没有像isLoaded()那样的东西我覆盖它.但我花了一些时间才弄明白并让它发挥作用.这是代码(在咖啡脚本中).随意使用它.

通过这样做你可以做任何商店(协会):

store.isLoaded
Run Code Online (Sandbox Code Playgroud)

如果要在商店中调用方法,但需要加载商店,则可以使用

store.invokeWhenLoaded(yourFunction)
Run Code Online (Sandbox Code Playgroud)

代码是自我解释(我认为:-))

###
Because Ext.data.Store is missing something like 'isLoaded'
this adds the possibility to figure it out.
As a bonus ;-) there is a method called invokeWhenLoaded that you can
pass a function to that will be called once the store is loaded.
###
Ext.data.AbstractStore.override(
  constructor:(config) ->
    # Add additional properties to config
    Ext.apply(config, {
      isLoaded: false
      waitlist: []
    })
    # Call overridden constructor and remember return value
    rslt = @callOverridden(arguments)
    # Add onLoad …
Run Code Online (Sandbox Code Playgroud)

extjs extjs4

5
推荐指数
0
解决办法
3726
查看次数

细长弦内的红宝石

在erb文件中我可以做类似的事情

<tr class="<%= cycle('list_line_odd', 'list_line_even') %>">
Run Code Online (Sandbox Code Playgroud)

这条线怎么看起来很苗条?谢谢.

html ruby erb slim-lang

2
推荐指数
1
解决办法
1242
查看次数

标签 统计

bit-manipulation ×1

erb ×1

extjs ×1

extjs4 ×1

html ×1

javascript ×1

ruby ×1

slim-lang ×1