[CLOSED] Store Problem

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Store Problem

    I have a Store:

    @(Html.X.Store().ID("EmployeeData") _
        .DataSource(ViewData("Employees")) _
        .Model(Sub(mdl)
                       mdl.Add(Html.X.Model.Fields(Sub(flds)
                                                           flds.Add("Text")
                                                           flds.Add("Value")
                                                   End Sub))
               End Sub))
    And I have a grid where I want the store to be used as the source in a column editor, so I am trying to set the editor's store to the ID of my predefined one.
    cols.Add(Html.X.Column().DataIndex("DrafterEmployeeID").Text("Drafter1").Editor(Sub(edt)
                                                                                                                                                Dim cbo As New Ext.Net.ComboBox
                                                                                                                                                With cbo
                                                                                                                                                    .ID = "DrafterEmployeeID"
                                                                                                                                                    .StoreID = "EmployeeData"
                                                                                                                                                    .MultiSelect = False
                                                                                                                                                    .AutoDataBind = True
                                                                                                                                                    .TypeAhead = True
                                                                                                                                                    .DisplayField = "Text"
                                                                                                                                                    .ValueField = "Value"
                                                                                                                                                End With
                                                                                                                                                edt.Add(cbo)
                                                                                                                                            End Sub))
    When I run the page, I keep getting an error that the store (with ID "EmployeeData") cannot be found. I do have the store definied before the grid and when I view the source for the page, I see this:

    window.App.EmployeeData=Ext.create("Ext.data.Store",{model:Ext.define(Ext.id(), {extend: "Ext.data.Model", fields:[{name:"Text"},{name:"Value"}] }),storeId:"EmployeeData",autoLoad:true,proxy:{data:...
    What are some possibilities as to why my grid having trouble finding the store?
    Last edited by Daniil; May 21, 2012 at 1:25 PM. Reason: [CLOSED]
  2. #2
    Hi,

    The fix has been added to SVN, please update and retest.

    Thanks for the report!
  3. #3
    The code no longer complains about being unable to find the storeID, but now it has made the App (javascript) object invalid. All my javascript is broken. :(
  4. #4
    Quote Originally Posted by adelaney View Post
    it has made the App (javascript) object invalid.
    Could you provide more details? Posting a sample to reproduce the problem would be best.
  5. #5
    Here is the specific error:
    invalid property id
    [Break On This Error]     
    ...peAhead:true,valueField:"Value",{raw}store:EployeeData},text:"Drafter"},{dataInd...
    Line 46
    (The error arrow points specifically to the first { in "{raw}")

    Also, I don't know if this matters, but this store and grid are in a partial view.
    Last edited by Daniil; May 17, 2012 at 7:08 PM. Reason: Please use [CODE] tags
  6. #6
    Thanks for the report. We are working on the fix.
  7. #7
    Fixed in SVN. Please update and retest
  8. #8
    It still does not render. Now, I have this error: "EmployeeData is not defined" with the javascript break not being indicated, so I don't know where the problem is. I do have output, but I cannot share that data in a public forum as it contains some real employee data. At this point, I am unsure how to proceed.
  9. #9
    Well, I think i know what the problem. You store instance is App.EmployeeData (with App namespace) therefore combo cannot find it.
    I will add support for id with namespace soon

    I do have output, but I cannot share that data in a public forum as it contains some real employee data.
    We don't required real data, you can alwayse to replace it by test data

    I will post notification today about fix
  10. #10
    That did it. If I go back into the code and make the StoreID="App.EmployeeData", it works. Now the question is how do I get the combo to recognize my EmployeeID as the selected value? I have .AutoDataBind = True. Do I need to manually set the .Value property, and if so, how do I get the row's current EmployeeID value?

    cols.Add(Html.X.Column().DataIndex("DrafterEmployeeID").Text("Drafter").Editor(Sub(edt)
      Dim cbo As New Ext.Net.ComboBox
        With cbo
          .ID = "DrafterEmployeeID"
          .StoreID = "App.EmployeeData"
          .MultiSelect = False
          .AutoDataBind = True
          .TypeAhead = True
          .DisplayField = "Text"
          .ValueField = "Value"
        End With
      edt.Add(cbo)
    End Sub))
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] store.insert method + store page size problem
    By mcfromero in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 12, 2012, 6:34 AM
  2. [CLOSED] Is Store Loading Problem
    By jesperhp in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 09, 2011, 9:25 AM
  3. [CLOSED] Store HTTPproxy problem
    By webppl in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Nov 07, 2010, 11:13 PM
  4. [CLOSED] Problem with Gridview and Store
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 04, 2009, 11:26 AM
  5. [CLOSED] [1.0] Store callback problem
    By state in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 20, 2009, 6:19 PM

Tags for this Thread

Posting Permissions