Search Results

Search found 14 results on 1 pages for 'jsonstore'.

Page 1/1 | 1 

  • JsonStore.insert() causes exception in extjs

    - by kalan
    I have an EditorGridPanel with toolbar button to add new records. Everything works fine except one scenario. When I try to insert a record which already exists in database, server sends back: {"success":false,"message":"already exists","data":{}} but grid creates a new row marked with red triangle. If after that I try to insert a new record (even if it doesn't exist in database), everything works fine on the server side, but i get an 'uncaught exception' in firebug. It says: 'uncaught exception: Ext.data.DataReader: #realize was called with invalid remote-data. Please see the docs for DataReader#realize and review your DataReader configuration.' why is that?

    Read the article

  • problem with JsonStore and JsonReader

    - by kalan
    Hello, In my ExtJS application I use EditorGridPanel to show data from server. var applicationsGrid = new Ext.grid.EditorGridPanel({ region: 'west', layout: 'fit', title: '<img src="../../Content/img/app.png" /> ??????????', collapsible: true, margins: '0 0 5 5', split: true, width: '30%', listeners: { 'viewready': { fn: function() { applicationsGridStatusBar.setText('??????????: ' + applicationsStore.getTotalCount()); } } }, store: applicationsStore, loadMask: { msg: '????????...' }, sm: new Ext.grid.RowSelectionModel({ singleSelect: true, listeners: { 'rowselect': { fn: applicationsGrid_onRowSelect} } }), viewConfig: { forceFit: true }, tbar: [{ icon: '../../Content/img/add.gif', text: '????????' }, '-', { icon: '../../Content/img/delete.gif', text: '???????' }, '-'], bbar: applicationsGridStatusBar, columns: [{ header: '??????????', dataIndex: 'ApplicationName', tooltip: '???????????? ??????????', sortable: true, editor: { xtype: 'textfield', allowBlank: false } }, { header: '<img src="../../Content/img/user.png" />', dataIndex: 'UsersCount', align: 'center', fixed: true, width: 50, tooltip: '?????????? ????????????? ??????????', sortable: true }, { header: '<img src="../../Content/img/role.gif" />', dataIndex: 'RolesCount', align: 'center', fixed: true, width: 50, tooltip: '?????????? ????? ??????????', sortable: true}] }); When I use JsonStore without reader it works, but when I try to update any field it uses my 'create' url instead of 'update'. var applicationsStore = new Ext.data.JsonStore({ root: 'applications', totalProperty: 'total', idProperty: 'ApplicationId', messageProperty: 'message', fields: [{ name: 'ApplicationId' }, { name: 'ApplicationName', allowBlank: false }, { name: 'UsersCount', allowBlank: false }, { name: 'RolesCount', allowBlank: false}], id: 'app1234', proxy: new Ext.data.HttpProxy({ api: { create: '/api/applications/getapplicationslist1', read: '/api/applications/getapplicationslist', update: '/api/applications/getapplicationslist2', destroy: '/api/applications/getapplicationslist3' } }), autoSave: true, autoLoad: true, writer: new Ext.data.JsonWriter({ encode: false, listful: false, writeAllFields: false }) }); I believe that the problem is that I don't use reader, but when I use JsonReader grid stops showing any data at all. var applicationReader = new Ext.data.JsonReader({ root: 'applications', totalProperty: 'total', idProperty: 'ApplicationId', messageProperty: 'message', fields: [{ name: 'ApplicationId' }, { name: 'ApplicationName', allowBlank: false }, { name: 'UsersCount', allowBlank: false }, { name: 'RolesCount', allowBlank: false}] }); var applicationsStore = new Ext.data.JsonStore({ id: 'app1234', proxy: new Ext.data.HttpProxy({ api: { create: '/api/applications/getapplicationslist1', read: '/api/applications/getapplicationslist', update: '/api/applications/getapplicationslist2', destroy: '/api/applications/getapplicationslist3' } }), reader: applicationReader, autoSave: true, autoLoad: true, writer: new Ext.data.JsonWriter({ encode: false, listful: false, writeAllFields: false }) }); So, does anyone know what the problem might be and how to solve it. The data returned from my server is Json-formated and seams to be ok {"message":"test","total":2,"applications":[{"ApplicationId":"f82dc920-17e7-45b5-98ab-03416fdf52b2","ApplicationName":"Archivist","UsersCount":6,"RolesCount":3},{"ApplicationId":"054e2e78-e15f-4609-a9b2-81c04aa570c8","ApplicationName":"Test","UsersCount":1,"RolesCount":0}]}

    Read the article

  • Ext.data.JsonStore + Ext.DataView = not loading records

    - by Mulone
    Hi guys, I'm trying to make a DataView work (on Ext JS 2.3). Here is the jsonStore, which seems to be working (it calls the server and gets a valid response). Ext.onReady(function(){ var prefStore = new Ext.data.JsonStore({ autoLoad: true, //autoload the data url: 'getHighestUserPreferences', baseParams:{ userId: 'andreab', max: '50' }, root: 'preferences', fields: [ {name:'prefId', type: 'int'}, {name:'absInteractionScore', type:'float'} ] }); Then the xtemplate: var tpl = new Ext.XTemplate( '<tpl for=".">', '<div class="thumb-wrap" id="{name}">', '<div class="thumb"><img src="{url}" title="{name}"></div>', '<span class="x-editable">{shortName}</span></div>', '</tpl>', '<div class="x-clear"></div>' ); The panel: var panel = new Ext.Panel({ id:'geoPreferencesView', frame:true, width:600, autoHeight:true, collapsible:false, layout:'fit', title:'Geo Preferences', And the DataView items: new Ext.DataView({ store: prefStore, tpl: tpl, autoHeight:true, multiSelect: true, overClass:'x-view-over', itemSelector:'div.thumb-wrap', emptyText: 'No images to display' }) }); panel.render('extOutput'); }); What I get in the page is a blue frame with the title, but nothing in it. How can I debug this and see why it is not working? Cheers, Mulone

    Read the article

  • EXTJS 3.2.1 EditorGridPanel - ComboBox with jsonstore

    - by Yoong Kim
    Hi, I am using EXTJS with an editorgridpanel and I am trying to to insert a combobox, populated with JsonStore. Here is a snapshot of my code: THE STORE: kmxgz.ordercmpappro.prototype.getCmpapproStore = function(my_url) { var myStore = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: my_url , method: 'POST' }) , reader: new Ext.data.JsonReader({ root: 'rows', totalProperty: 'total', id: 'list_cmpappro_id', fields: [ {name: 'list_cmpappro_id', mapping: 'list_cmpappro_id'} , {name: 'list_cmpappro_name', mapping: 'list_cmpappro_name'} ] }) , autoLoad: true , id: 'cmpapproStore' , listeners: { load: function(store, records, options){ //store is loaded, now you can work with it's records, etc. console.info('store load, arguments:', arguments); console.info('Store count = ', store.getCount()); } } }); return myStore; }; THE COMBO: kmxgz.ordercmpappro.prototype.getCmpapproCombo = function(my_store) { var myCombo = new Ext.form.ComboBox({ typeAhead: true, lazyRender:false, forceSelection: true, allowBlank: true, editable: true, selectOnFocus: true, id: 'cmpapproCombo', triggerAction: 'all', fieldLabel: 'CMP Appro', valueField: 'list_cmpappro_id', displayField: 'list_cmpappro_name', hiddenName: 'cmpappro_id', valueNotFoundText: 'Value not found.', mode: 'local', store: my_store, emptyText: 'Select a CMP Appro', loadingText: 'Veuillez patienter ...', listeners: { // 'change' will be fired when the value has changed and the user exits the ComboBox via tab, click, etc. // The 'newValue' and 'oldValue' params will be from the field specified in the 'valueField' config above. change: function(combo, newValue, oldValue){ console.log("Old Value: " + oldValue); console.log("New Value: " + newValue); }, // 'select' will be fired as soon as an item in the ComboBox is selected with mouse, keyboard. select: function(combo, record, index){ console.log(record.data.name); console.log(index); } } }); return myCombo; }; The combobox is inserted in an editorgridpanel. There's a renderer like this: Ext.util.Format.comboRenderer = function(combo){ return function(value, metadata, record){ alert(combo.store.getCount()); <== always 0!! var record = combo.findRecord(combo.valueField || combo.displayField, value); return record ? record.get(combo.displayField) : combo.valueNotFoundText; } }; When the grid is displayed the first time, instead of have the displayField, I have : "Value not found." And I have the alert : 0 (alert(combo.store.getCount())) from the renderer. But I can see in the console that the data have been correctly loaded! Even if I try to reload the store from the renderer (combo.store.load();), I still have the alert (0)! But when I select the combo to change the value, I can see the data and when I change the value, I can see the displayFiel! I don't understand what's the problem? Since now several days, I already tried all the solutions I found...but still nothing! Any advice is welcome! Yoong

    Read the article

  • Dojo Datagrid Filtering Issue

    - by Zoom Pat
    I am having hard time filtering a datagrid. Please help! This is how I draw a grid. var jsonStore = new dojo.data.ItemFileWriteStore({data:columnValues}); gridInfo = { store: jsonStore, queryOptions: {ignoreCase: true}, structure: layout }; grid = new dojox.grid.DataGrid(gridInfo, "gridNode"); grid.startup(); Now if i try something like this, it works fine and gives me the rows which has the column (AGE_FROM) value equal to 63. grid.filter({AGE_FROM:63}); but I need all kinds of filtering and not just 'equal to' So how do I try to obtain all the rows which have AGE_FROM 63, and < 63 and <= 63 and =63. because grid.filter({AGE_FROM:<63}); does not work Also One other way I was thingking was to use the following filteredStore = new dojox.jsonPath.query(filterData,"[?(@.AGE_FROM = 63]"); and then draw the grid with the filteredStore, but the above is not working for a != operator. Once I figure a good way to filter grid I need to see a way to filter out dates. I am trying to find a good example for filtering dataGrid but most of the examples are just filtering based on the 'equal to' criteria. Any help is highly appreciated.

    Read the article

  • How to control Dojo FilteringSelect default rendering!?

    - by Nick
    Hi, I have a dojo dijit.filering.select that populates with values from a dojo.data.ItemFileReadStore. Everything is working fine except I would like the filtering select to automatically get populated with the first value in the itemFileReadStore. Currently it is loading them as a list of options that are revealed when you click the down arrow, as per spec. I would instead like filteringSelect to be loaded with the first value. How do I do this? For some reason I cant figure it out. Any help would be hugely appreciated! Kind Regards Nick Frandsen <script type="text/javascript"> function updateOptions(){ var itemId = dijit.byId("item_select").attr("value"); var jsonStore = new dojo.data.ItemFileReadStore({ url: "/options/get-options-json/itemId/" + itemId }); optionSelect.attr("store", jsonStore); } </script> <select dojoType="dijit.form.FilteringSelect" name="option_select" id="option_select" labelAttr="name" required="true" jsId="optionSelect"> </select>

    Read the article

  • extJs Json Reader

    - by tinti
    Please help me with this problem. I'm new in extJs and i need a little help. I have this code Ext.onReady(function() { var datesStore = new Ext.data.JsonStore({ start : 'StartTableDate', end : 'FinishTableDate', autoLoad : true, proxy : new Ext.data.HttpProxy({ url : 'dates.json', method:'GET' }), fields : [ // 2 mandatory fields {name:'StartTableDate'}, {name:'FinishTableDate'} ] }); // i want to pass to variable start si end the values from JSON var start = 'StartTableDate'; var end = 'FinishTableDate';

    Read the article

  • ExtJS combo setting problem

    - by Hubidubi
    Hi I run into an interesting problem while was using combos in input form. My form contains combos that get data from json stores. It works fine when adding new record, but when the form is opened for editing an existing record, sometimes the id appears as selected not its value (eg: there's 5 instead of "apple"). I think it tries to set the value before it finishes loading the combo. Is there a way to solve this? I put the code down here that creates combos: function dictComboMaker( store, fieldLabel, hiddenName, name, allowBlank, myToolTipp ) { comboo = { xtype : 'combo', id: 'id-'+name, allowBlank: allowBlank, fieldLabel : fieldLabel, forceSelection : true, displayField : 'value', valueField : 'id', editable: false, name: name, hiddenName : hiddenName, minChars : 2, mode: 'remote', triggerAction : 'all', store : store }; function dictJsonMaker(url) { store = new Ext.data.JsonStore({ root : 'results', // 1 fields : [ 'id','value' ], url : url, autoLoad: true}); return store; } var comboKarStore = dictJsonMaker('/service/karok'); var comboKar= dictComboMaker(comboKarStore, 'Kar', 'karid', 'kar', false, ''); // then comboKar is added to the form Hubidubi

    Read the article

  • How to read and set a value of a specific cell in an ExtJS Grid ?

    - by Lou
    Hello, I am beginning with ExtJS. I am trying to read a value from a cell that is selected I use an EditorGrid and the store looking like that : my_store = new Ext.data.JsonStore({ root: 'topics', totalProperty: 'totalCount', idProperty: 'details_id', fields: [ {name : 'index', type : 'int'}, {name : 'inactive', type : 'int'}, {name : 'c_1', type : 'string'}, {name : 'c_2', type : 'string'}, {name : 'c_3', type : 'string'}, {name : 'c_4', type : 'string'} ], proxy: new Ext.data.ScriptTagProxy({ url: 'my_proxy_url' }) }); As of now, this is what I use to retrieve the rows and columns of the selected cell : var column = grid.getSelectionModel().selection.cell[0]; var row = grid.getSelectionModel().selection.cell[1]; How can I read the value of a selected cell in the grid and change this value ?

    Read the article

  • EXT-js PropertyGrid best practices to achieve an update ?

    - by Tom
    Hello, I am using EXT-js for a project, usually everything is pretty straight forward with EXT-js, but with the propertyGrid, I am not sure. I'd like some advice about this piece of code. First the store to populate the property grid, on the load event: var configStore = new Ext.data.JsonStore({ // store config autoLoad:true, url: url.remote, baseParams : {xaction : 'read'}, storeId: 'configStore', // reader config idProperty: 'id_config', root: 'config', totalProperty: 'totalcount', fields: [{ name: 'id_config' }, { name: 'email_admin' } , { name: 'default_from_addr' } , { name: 'default_from_name' } , { name: 'default_smtp' } ],listeners: { load: { fn: function(store, records, options){ // get the property grid component var propGrid = Ext.getCmp('propGrid'); // make sure the property grid exists if (propGrid) { // populate the property grid with store data propGrid.setSource(store.getAt(0).data); } } } } }); here is the propertyGrid: var propsGrid = new Ext.grid.PropertyGrid({ renderTo: 'prop-grid', id: 'propGrid', width: 462, autoHeight: true, propertyNames: { tested: 'QA', borderWidth: 'Border Width' }, viewConfig : { forceFit: true, scrollOffset: 2 // the grid will never have scrollbars } }); So far so good, but with the next button, I'll trigger an old school update, and my question : Is that the proper way to update this component ? Or is it better to user an editor ? or something else... for regular grid I use the store methods to do the update, delete,etc... The examples are really scarce on this one! Even in books about ext-js! new Ext.Button({ renderTo: 'button-container', text: 'Update', handler: function(){ var grid = Ext.getCmp("propGrid"); var source = grid.getSource(); var jsonDataStr = null; jsonDataStr = Ext.encode(source); var requestCg = { url : url.update, method : 'post', params : { config : jsonDataStr , xaction : 'update' }, timeout : 120000, callback : function(options, success, response) { alert(success + "\t" + response); } }; Ext.Ajax.request(requestCg); } }); and thanks for reading.

    Read the article

  • GridPanel in Extjs is not loaded

    - by pho3nix
    I have this code in my application, but this not load any data. Data is accessible but wont display in my gridpanel, anyone have idea, why? Ext.onReady(function () { Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = 'side'; var btnAdd = new Ext.Button({ id: 'btnAdd', text: 'Adicionar', iconCls: 'application_add', handler: function (s) { } }); var btnEdit = new Ext.Button({ id: 'btnEdit', text: 'Editar', iconCls: 'application_edit', handler: function (s) { } }); var btnRemove = new Ext.Button({ id: 'btnRemove', text: 'Apagar', iconCls: 'application_delete', handler: function (s) { } }); var tbar = new Ext.Toolbar({ items: [btnAdd, btnEdit, btnRemove] }); var formFind = new Ext.FormPanel({ height: 100 }); var store = new Ext.data.JsonStore({ remoteSort: true, idProperty: 'ContentId', root: 'rows', totalProperty: 'results', fields: [ { name: 'ContentId', type: 'int' }, { name: 'Name' }, { name: 'Version' }, { name: 'State' }, { name: 'CreatedDateTime' }, { name: 'PublishedDateTime'}, { name: 'CreatedByUser' }, { name: 'PublishedByUser' } ], proxy: new Ext.data.ScriptTagProxy({ url: '/Admin/ArticleList' }) }); store.setDefaultSort('ContentId', 'desc'); var paging = new Ext.PagingToolbar({ store: store, pageSize: 25, displayInfo: true, displayMsg: 'Foram encontrados {2} registos. Mostrando {0} de {1}', emptyMsg: "Nenhum registo encontrado." }); var grid = new Ext.grid.GridPanel({ id: 'grid', height: 700, store: store, loadMask: true, loadingText: 'Carregando...', autoHeight: true, cm: new Ext.grid.ColumnModel ([ { id: 'ContentId', dataIndex: 'ContentId', header: 'Identif.', width: 60, sortable: true }, { id: 'Name', dataIndex: 'Name', header: 'Titulo', width: 75, sortable: true }, { id: 'Version', dataIndex: 'Version', header: 'Versão', width: 75, sortable: true }, { id: 'State', dataIndex: 'State', header: 'Estado', width: 75, sortable: true }, { id: 'CreatedDateTime', dataIndex: 'CreatedDateTime', header: 'Data de Criação', width: 85, sortable: true }, { id: 'PublishedDateTime', dataIndex: 'PublishedDateTime', header: 'Data de Publicação', width: 75, sortable: true }, { id: 'CreatedByUser', dataIndex: 'CreatedByUser', header: 'Criado por', width: 75, sortable: true }, { id: 'PublishedByUser', dataIndex: 'PublishedByUser', header: 'Publicado por', width: 85, sortable: true } ]), stripeRows: true, viewConfig: { forceFit: true }, bbar: paging }); var panel = new Ext.Panel({ id: 'panel', renderTo: Ext.getBody(), layout: 'fit', tbar: tbar, items: [grid] }); store.load(); // trigger the data store load });

    Read the article

  • How to send a JSONObject to a REST service?

    - by Sebi
    Retrieving data from the REST Server works well, but if I want to post an object it doesn't work: public static void postJSONObject(int store_type, FavoriteItem favorite, String token, String objectName) { String url = ""; switch(store_type) { case STORE_PROJECT: url = URL_STORE_PROJECT_PART1 + token + URL_STORE_PROJECT_PART2; //data = favorite.getAsJSONObject(); break; } HttpClient httpClient = new DefaultHttpClient(); HttpPost postMethod = new HttpPost(url); try { HttpEntity entity = new StringEntity("{\"ID\":0,\"Name\":\"Mein Projekt10\"}"); postMethod.setEntity(entity); HttpResponse response = httpClient.execute(postMethod); Log.i("JSONStore", "Post request, to URL: " + url); System.out.println("Status code: " + response.getStatusLine().getStatusCode()); } catch (ClientProtocolException e) { I always get a 400 Error Code. Does anybody know whats wrong? I have working C# code, but I can't convert: System.Net.WebRequest wr = System.Net.HttpWebRequest.Create("http://localhost:51273/WSUser.svc/pak3omxtEuLrzHSUSbQP/project"); wr.Method = "POST"; string data = "{\"ID\":1,\"Name\":\"Mein Projekt\"}"; byte [] d = UTF8Encoding.UTF8.GetBytes(data); wr.ContentLength = d.Length; wr.ContentType = "application/json"; wr.GetRequestStream().Write(d, 0, d.Length); System.Net.WebResponse wresp = wr.GetResponse(); System.IO.StreamReader sr = new System.IO.StreamReader(wresp.GetResponseStream()); string line = sr.ReadToEnd();

    Read the article

  • Check the code n point the mistake

    - by Vibha
    here is the code: Ext.onReady(function(){ alert("inside onReady"); Ext.QuickTips.init(); var employee = Ext.data.Record.create([ {name:'firstname'}, {name:'lastname'}]); var myReader = new Ext.data.JsonReader({ root:"EmpInfo", },employee); var store = new Ext.data.JsonStore({ id:'ID' ,root:'EmpInfo' ,totalProperty:'totalCount' ,url:'test.php' ,autoLoad:true ,fields:[ {name:'firstname', type:'string'} ,{name:'lastname', type:'string'} ] }); var myPanel = new Ext.grid.GridPanel({ store: store ,columns:[{ dataIndex:'firstname' ,header:'First Name' ,width:139 },{ dataIndex:'lastname' ,header:'Middle Name' ,width:139 } ] }); var myWindow = new Ext.Window({ width:300, height:300, layout:'fit', closable:false, resizable:false, items:[myPanel] }); myWindow.show(); }); And php code is: true, "data" = array( "firstname" = "ABC" , "lastname" = "MNO") ); $_SESSION["err"] = isset($_SESSION["err"]) ? !$_SESSION["err"] : true; header("Content-Type: application/json"); echo json_encode($o); ? I want to print the values ABC and MNO in the grid panel. i'm using extjs 2.3. please help me out. Thanks

    Read the article

  • HELP Retrieving the url parameter from a JSON store from a EXTJS ComboBox

    - by Newbie
    I am having a problem retrieving the parameters from the url section of a json store for a combobox in EXTJS from my code behind page in c#. The following is the code in the store: var ColorStore = new Ext.data.JsonStore( { autoLoad: true, url: '/proxies/ReturnJSON.aspx?view=rm_colour_view', root: 'Rows', fields: ['company', 'raw_mat_col_code', 'raw_mat_col_desc'] }); And the following code is in my code behind page: protected void Page_Load(object sender, EventArgs e) { string jSonString = ""; connectionClass.connClass func = new connectionClass.connClass(); DataTable dt = func.getDataTable("sELECT * from rm_colour_view"); //Response.Write(Request.QueryString["view"]); string w = Request.Params.Get("url"); string z = Request.Params.Get("view"); string x = Request.Params.Get("view="); string c = Request.Params.Get("?view"); string s = Request.QueryString.Get("view"); string d = Request.Params["?view="]; string f = Request.Form["ColorStore"]; jSonString = Serialize(dt); Response.Write(jSonString); } The string w has gives the following output: /proxies/ReturnJSON.aspx but all the others strings return null... How can rm_colour_view from the datastore then be retrived??? Any help would be appreciated! Thanks

    Read the article

1