jsonstore

CRUD Operation in JSONStore using MobileFirst Platform 7.1

柔情痞子 提交于 2019-12-12 02:41:07
问题 I'm new to MFP and I'm trying to perform a basic CRUD operation. Nothing is happening after the following code is executed. I will highly appreciate if i can get some help. Thank you. main.js function wlCommonInit () { var collections = { people : { searchFields: {name: 'string', age: 'integer'} } }; WL.JSONStore.init(collections).then(function (collections) { // handle success - collection.people (people's collection) }).fail(function (error) { alert("alert" + error); // handle failure });

joining two collections in json store

落爺英雄遲暮 提交于 2019-12-12 02:07:18
问题 Is it possible to join two collections in JSONStore? I want to access data from the given two collections in the json store one of which has a foreign key. 回答1: There's nothing equivalent to a join in Relational Databases for JSONStore. However, like Namfo said in the other answer, you may take advantage of additionalSearchFields for this use case. It allows you to index values that are not part of the data being stored. For example, if you have a order collection and are storing objects like

How to implement password protect security in JsonStore Worklight 6.2?

孤街浪徒 提交于 2019-12-11 23:19:18
问题 I want to implement the app in worklight using JsonStore protection i want to store password based on logined user and add those password to options in WL.JSONStore.init(collections,options) . The rest of the details in data object data={} ; and how do i extract the password saved WL.JSONStore.init(collections,options) options object for making api calls for rest of the functions? 回答1: My take on the question: Storing the password in the device is indeed not a good practice to follow. There

How to query or access JSONStore data from native code in IBM Worklight?

橙三吉。 提交于 2019-12-11 20:33:24
问题 My app (iOS) will have a browser built in native code and the rest in Javascript using Worklight and there's a requirement to have a shared persistent database with encryption capability for both. JSONStore seems to have all the functionality I need, but it's only available with Javascript. Is there any way I can access it in the native code? 回答1: The feature will be available in worklight 6.2, which is out now... 回答2: Correct, JSONStore is only available in the hybrid (JavaScript) API. I am

IBM MobileFirst 7.1 with Android Cordova failure when init JSONStore

半腔热情 提交于 2019-12-11 15:06:10
问题 I am trying to create a 'heloworld' project with IBM Mobilefirst 7.1 integrate cordova using platform android and enable feature JSONStore Step 1: create mobilefirst cordova project flowing link https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/hello-world/integrating-mfpf-sdk-in-cordova-applications/#sampleApplication Note: platform android and add more plugin jsonstore Step 2: add feature JSONStore in application-descriptor.xml Step 3: add code in function wlCommonInit WL

IBM Worklight - How can I execute JavaScript code before updating the application?

我们两清 提交于 2019-12-11 12:51:50
问题 When a new software update is available, if user has data stored in jsonstore I need to allow user to commit them to the server before applying the software update, so his/her uncommited updates don't get lost. Currently user is unable to use the application until the update is installed. Is there a way to execute JavaScript code before updating the application so I can initialize the jsonstore, take the data and send to the adapter before performing the update installation? 回答1: There is no

How to enable WL.JSONStore in Worklight project?

不想你离开。 提交于 2019-12-11 12:13:11
问题 When I played with the sample Using_JSONStore, I always tested WL.JSONStore=="undefined" on Android Mobile Browser Simulator or on a Android Virtual Device Emulator, or on my real Android device (Android version 2.3.5). How to enable the WL.JSONStore feature in the Worklight project? Thanks. 回答1: In Worklight 5.0.6.x, JSONStore is always part of the Android and iOS environments, so it is always present. There is nothing to 'enable'. What you want to do, is perhaps initialize it, that is - use

Declare array into searchFields Worklight JSONStore

核能气质少年 提交于 2019-12-11 11:45:40
问题 I have a JSON object to my collection with JSONStore like this: { name : 'name1', industry : ['Banking', 'Energy', 'Insurance', 'Media', 'Retail', 'Telco', 'Travel'], buyer : ['CMO'], link : 'foo.com' } But, how is possible declare the industry field into searchFields?, in order to search a pattern in the array. Cheers 回答1: There's no array type for search fields. You can only index values in objects that are string , boolean , number and integer . You could change: { industry : ['Banking',

ExtJS paged combo with remote JSON store. Display selected value with paging

六月ゝ 毕业季﹏ 提交于 2019-12-11 11:35:51
问题 I've got an ExtJS combo with remote store, which returns to me data in JSON format. When I select a value on the first page (for example) and then navigate to another page, the combo display selected id, not the value. How can I always display a selected value? Code: Ext.onReady(function() { Ext.define('Model', { extend: 'Ext.data.Model', fields: ['title'], idProperty: 'threadid' }); var store = Ext.create('Ext.data.Store', { pageSize: 50, model: 'Model', remoteSort: true, proxy: { type:

Worklight :: JSONStore :: How to work with additional search fields

爷,独闯天下 提交于 2019-12-11 07:41:32
问题 I'm using Worklight6.2 and I have a small problem related with JSONStores. I have several on my application to aid me relating to my relational model on a third party database. To properly work with this paradigm I'm trying to use several search indexes to find documents inside my store. Let's say I have a store with this aspect var data = {GUID: 'XPTO-XPTZ-FOO', product_name= 'potatos'} Sometimes I want to access my object by GUID some other times I want to access it by product_name. So I