Double data binding

  1. #1

    Double data binding

    Hello again)

    i have gridpanel with componentcolumn. As component i use formpanel.
    In ComponentColumn`s listeners i have released bind method.
    Why it works twice and after rendering my grid i get two forms with same ids, one of them has property destroyed = true, ohter doesn`t have such property?

    X.GridPanel()
    	.ColumnModel(
    		X.ComponentColumn()
    			.Listeners(ls =>
    				{
    					ls.Bind.Handler = @"bind(item,cmp,record);";
    				})
    			.Component(
    				X.FormPanel()
    					...
    			)
    	)
    bind method:
    function bind(item, cmp, record) {
        idPrefix = "ef_";
        cmp.setId(idPrefix + record.data.ItemValue);
        cmp.getForm().loadRecord(record);
    }
  2. #2
    Hello @Bogdan!

    I am afraid I cannot help you with the information you provided. Perhaps if you can make a runnable test case we could see the issue on our side, we could help with clarifying what's wrong and how to circumvent the issue -- or the proper way to attain your objective, given the test case context.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    @fabricio.murta, thank you for reply.

    In my view besides this grid was other container above but grid wasn`t in container.
    I placed grid into container and problem was solved.

    But i don`t understand why bind-listener works twice in grid without container?
  4. #4
    Hello again, @Bogdan!

    I can't see how the container could affect this behavior, except if you have some additional code behind or client-side custom javascript in the page that could mangle it in some way.

    Grids are a kind of container, they inherit from the container's class both client and server-side, so again, all I can think is your application has some code that's affecting this. I suggest you create an empty Ext.NET project to try to reproduce these issues so you can sure no other code is affecting the result.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    @fabricio.murta, may be you can help me with other question, related with binding, too?

    How can i trigger bind event for componentColumn only after my grid`s store is loaded? Now bind-listener event works after every "set" operation:

    var exist = App.myStore.findRecord('Id', id);
    exist.set(itemName, newValue);
    But i don`t need it after every "set", i want bind data only after store`s load event.
  6. #6
    Hello @bogdan!

    Please open new threads for new questions; although this one regards to "binding" it does not involve "double" and involves a new aspect as the event, and when you want it to trigger.

    Well, anyway, you still didn't specify what binding event you're talking about (which component exactly), I don't see any 'binding' code in the code snippet you shared, so I'm pretty clueless here.

    Best I can think is, you should rely on the store's load event to run code once the store gets loaded (or reloaded), and not at every change/update.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 3
    Last Post: Jun 26, 2015, 11:46 AM
  2. Data not binding into ComboBox
    By nagesh in forum 1.x Help
    Replies: 5
    Last Post: Jul 12, 2012, 2:35 PM
  3. [CLOSED] Data binding to NetTiers data entity objects
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Apr 09, 2012, 3:35 PM
  4. Replies: 4
    Last Post: Nov 22, 2010, 12:54 PM
  5. Data Binding
    By Deepak in forum 1.x Help
    Replies: 3
    Last Post: Nov 04, 2010, 10:27 AM

Posting Permissions