In My Program I'am Using Grid Pagination. In a particular situvation I need the totalPage
count of a store.Any Way To Get it?
Please Help Me....
Your server should send back the total number of records, something like this:
{
success:true,
total:999,
records:[
{
id:1,
name:'Arundev PV'
}
]
}
then you can use store.getTotalCount() to get that value.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Store-method-getTotalCount
you can customize the name of the "total" property with
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.reader.Reader-cfg-totalProperty
Related
I have a collection and i want to show like some characteres from "categoria" which is inside "Problema", but it keeps giving me this error, and i have searched alot and i think everything is correct, any help?
In order to use $substr you will need to use an aggregation
I tried the aggregation tool in Compass, but it is not clear to me.
However, I tried this aggregation with one collection:
db.getCollection('products').aggregate(
[
{
$project:
{
tex: { $substr: ["$name",2,7] }
}
}
])
I am super confused with the documentation on Shopify. I wanted to use their Javascript Buy SDK. To follow their simple product fetch example, in the docs, it says that "Before you can retrieve a product or collection, you need to query for a Storefront ID. After you've obtained either a product ID or collection ID, you can fetch the product or collection using the SDK."
So using the Shopify Graphiql app and from the example to get a storefront ID, the request looks like this.
{
shop {
productByHandle(handle: "my-own-product-handle") {
id
}
}
}
the expected return id is somewhat like
"id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzczNDE0OTkzOTk=" in some sort of encoded value. But however the ID I am getting is like a URL. Here is what I got in return.
{
"data": {
"shop": {
"productByHandle": {
"id": "gid://shopify/Product/1349634097238"
}
}
},
"extensions": {
"cost": {
"requestedQueryCost": 2,
"actualQueryCost": 2,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 998,
"restoreRate": 50
}
}
}
}
When I use this URL to do a request as shown in JS SDK example
// Fetch a single product by ID
const productId = 'gid://shopify/Product/13496340972223';
client.product.fetch(productId).then((product) => {
// Do something with the product
console.log(product);
});
I get the error in the console that Variable id of type ID! was provided invalid value.
I am not able to figure out where I am missing the dots.
Please help!
Thanks.
Think I have cracked it.... or at least found a work around. This should be clearer I feel, which makes me think I'm wrong.... anyway, here's what I found out.
When using the Shopify graphiQl app you can ask for the id. (just as you have shown above). Take the result and encode it into base64 here..
https://www.base64encode.org/
That will give you the result - 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzEzNDk2MzQwOTcyMjIz'.
Stick that in your productId variable and you should get a response.
I am using EXTJS 4.2.1 and my application has a grid including paging, the grouping summary and the summary feature. I want to override the sum of the summary feature, because it should display the grand total sum of the whole data set and not only for the current displayed page.
Is that possible to override the summary feature to do so?
Thanky you very much for every advice in advance. :-)
Use summaryRenderer in column configuration. It is an undocummented feature of ExtJS allowing you to show custom data in your summary row.
You will have to summarize the data server-side and send them to client where you will access it in the summaryRenderer.
Like so:
columns: {
items: [
{
text: "Column A",
dataIndex: "field_A",
summaryRenderer: function( value, summaryData, dataIndex ) {
var grid = this;
// Get the value here and return it
var result = functionToGetValue( grid );
return result;
}
},
// ...
}
]
The functionToGetValue is the place where you pass the summarization value you sent to your client from server.
How you do that depens on your code. You have access to store via grid.getStore().
It is possible to add the summary data to each record and then simply use store.getAt(0).get( 'summaryValue' ), it is kind of wasteful, but it is simple and it works.
Is it possible to fetch a traffic variable sProp1 along with PageName and Url when issuing a GetReport request of a Ranked report?
Let us say I have the following passed to SiteCatalyst (Omniture) via Java Script.
s.pageName = o_title; // Page Name
s.channel = o_structure; // SiteSection
s.prop1 = o_inode // Traffic variable also the Primary Key Id of the PageName
Now, if I run a RankedReport, I will get the following
PageName
PageViews
Url
Along with this info, I will also be interested in fetching the s.prop1 value. I will need the s.prop1 value to use it on my db to query the first sentence of the article from db (and other metadata) and show the results on the results page that shows the most popular pages. Can this be achieved? I mean is it possible to get the traffic variable associated with the pageName?
Thanks,
Rag
OK. I think I if I add another element (prop1) I get the breakdown. {
"reportDescription":{
"reportSuiteID":"*",
"dateFrom":"2013-03-06",
"dateTo":"2013-03-15",
"metrics":[
{
"id":"pageviews",
"name":"Page Views",
"type":"number"
}
],
"sortBy":"pageviews",
"elements":[
{
"id":"siteSection"
},
{
"id":"page"
},
{
"id":"prop1"
}
],
"locale":"en_US"
},
"validate":"false"
}
Is there any way to find an "item" inside an Dojo Store (Version 1.1!!).
The Format of the Json Data is like: name/id.
So far if tryed it with:
var storeItem = this.myFilteringSelect.store.fetch({query: {name: "Alpha"}});
But fetch does not return the item? Btw. i need the "ID" of the Item to set an default value for the filteringSelect (but the id can change from time to time...)
Let me preface my answer in that I can't speak to 1.1 specifically. But in 1.6...
store.fetch is coded in an asynchronous manner. It does not return the item. You must provide a callback that will iterate over the items returned from the query.
store.fetch({
query: {/*queryParams*/},
onComplete: function(items, findResult){
dojo.forEach(items, function(item){
// work with your item
}
}
});
https://dojotoolkit.org/reference-guide/1.6/dojo/data/api/Read.html#dojo-data-api-read
I don't believe this API had changed much over time, so if it is present in 1.1, then I think this should help.