小编Aja*_*kur的帖子

如何在拖动项目时在Extjs中创建占位符

我想在将项目从一个面板拖动到另一个面板时在Extjs中创建占位符.项目是dataView记录.

Ext.application({
  name: 'Fiddle',

  launch: function () {
    simpsonsStore = Ext.create('Ext.data.Store', {
      storeId: 'simpsonsStore',
      fields: ['id', 'name', 'email'],
      data: [{
        name: 'Lisa',
        email: 'lisa@simpsons.com',
        id: 1
      }, {
        name: 'Bart',
        email: 'bart@simpsons.com',
        id: 2
      }, {
        name: 'Homer',
        email: 'homer@simpsons.com',
        id: 3
      }, {
        name: 'Marge',
        email: 'marge@simpsons.com',
        id: 4
      }]
    });

    Ext.create('Ext.panel.Panel', {
      scrollable: 'horizontal',
      bodyCls: 'scrollBarOn',
      region: 'center',
      width: '100%',
      height: 800,
      layout: 'hbox',
      renderTo: Ext.getBody(),
      items: [{
        xtype: 'panel',
        width: 200,
        height: 500,
        items: [{
          xtype: 'dataview', …
Run Code Online (Sandbox Code Playgroud)

javascript jquery extjs extjs6-classic

9
推荐指数
1
解决办法
676
查看次数

如何将Name1拖到名称6面板

如何从另一个面板拖动面板项?

例如:我想将Name1拖到名称6面板.当我尝试按shift + mousescrollkey时,它会松动拖动项目.

提前致谢 :)

小提琴:https: //fiddle.sencha.com/#fiddle/1hgf&view/editor

    Ext.application({
    name: 'Fiddle',

    launch: function() {
        Ext.define('myColumn', {
            extend: 'Ext.view.View',
            xtype: 'mycolumn',

            padding: 5,
            margin: 5,
            style: 'background-color: #f2f2f2;',

            itemSelector: 'div.nameselector',
            tpl: ['<tpl for=".">', '<div class="nameselector<tpl if="isTemp"> temp</tpl>">', '{name}', '</div>', '</tpl>'],

            listeners: {
                render: function(me) {
                    var tempRec = null;

                    // Create drag zone
                    this.dragZone = new Ext.dd.DragZone(me.getEl(), {
                        // On receipt of a mousedown event, see if it is within a DataView node.
                        // Return a drag data object …
Run Code Online (Sandbox Code Playgroud)

drag-and-drop extjs extjs6 extjs6-classic

5
推荐指数
1
解决办法
485
查看次数

调用Backbone集合的fetch函数时,"未定义不是函数"错误

调用fetch函数时出错.

Undefined is not a function Error in Backbone js 
Run Code Online (Sandbox Code Playgroud)

var models = Backbone.Model.extend({
  userId: function() {
    return this.get('userId');
  },
  id: function() {
    return this.get('id');
  },
  body: function() {
    return this.get('body');
  }
});
//Collections
var todolistStore = Backbone.Collection.extend({
  url: function() {
    return 'https://jsonplaceholder.typicode.com/posts'
  },
  model: models,
  parse: function(response) {
    return response;
  }
});
todolistStore.fetch();
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.cdnjs.com/ajax/libs/underscore.js/1.1.4/underscore-min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js" type="text/javascript"></script>
Run Code Online (Sandbox Code Playgroud)

javascript backbone.js backbone.js-collections

0
推荐指数
1
解决办法
62
查看次数