Adjusting Context when using rallystandardreport - rally

I'm utilizing the rally standard report to generate an iteration burndown, but given that i want post this on a wiki/web page. Looking for a way to point this to a project/subproject so that I can have several instances of this on one page. I tried it via context, but I'm obviously missing something. The code is below, any guidance/recommendation would be greatly appreciated!
Thanks!
Mark
Ext.create('Ext.Container', {
context : {
workspace : 'https://rally1.rallydev.com/slm/webservice/v2.0/workspace/50876644101',
project : 'https://rally1.rallydev.com/slm/webservice/v2.0/project/50891172431'
},
items: [{
xtype: 'rallystandardreport',
width: 750,
height: 500,
reportConfig: {
report: 'IterationBurndown',
subchart: 'hide',
title : 'IterationBurndown',
project : 'Harrier'
}
}],
renderTo: Ext.getBody().dom
});

You're on the right track. The StandardReport component was one of the earliest ones written and so it doesn't quite follow the standard ability to pass in a context like most of the rest of the SDK.
You're on the right path with the project config above- it just needs to be the ref of the project you're targeting rather than the name, and it goes right on the root component config instead of beneath reportConfig. There are also projectScopeUp and projectScopeDown.
There's also a full example here: https://help.rallydev.com/apps/2.0/doc/#!/example/standard-report
{
xtype: 'rallystandardreport',
width: 750,
height: 500,
reportConfig: {
report: 'IterationBurndown',
subchart: 'hide',
title : 'IterationBurndown'
},
project: '/project/12345',
projectScopeUp: false,
projectScopeDown: true
}

Related

extjs Dynamically load nodes on scroll down

I am new to Ext Js 4.1, I have 5000 child nodes and need to load only 50 nodes on load,after scrolling down have to load another 50 nodes and continues. I am trying from past 2 days with different scenarios, but I didn't find anything related, can anu one please help me how to do, if possible with sample code.
Thanks in Advance
The only way to do this with a server that gives you your's 5000 child nodes is to use a buffered store.
Using a buffered store you can set your page dimensions and scrolling down changing the page you will be able to load your datas 50 by 50 records.
check all you need here http://docs.sencha.com/extjs/5.1/5.1.2-apidocs/#!/api/Ext.data.BufferedStore
buffered store disponible also on ext 4.1
also some examples on sencha examples
you can watch this
http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/infinite-scroll.html
Finally i find the solution that we need to use 'bufferedrenderer' Plugin.Infinite grid uses a buffered store, and is not supported for trees.
Here is the sample code
Ext.onReady(function () {
var store = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: 'http://localhost/codig/index.php/user/jsonusers',
extraParams:limitValue
}
});
store.reload();
var treePanel = Ext.create('Ext.tree.Panel', {
id:'mytree',
title: 'Infinite nodes tree',
width: 200,
height: 400,
store: store,
rootVisible: false,
plugins: {
ptype: 'bufferedrenderer'
},
renderTo: Ext.getBody()
});
});

Sencha Architect (touch) - Use camera photos

I have implemented my sencha architect project with a possibility to do a photo (with phonegap). After taking a photo, I need to see the photo directly into another container with other information (the picture will be smaller than the original...and there will be written above and below).
How do I open the new container and display the image in a smaller size?
please help me, I don't understand how can I manage the photo
Now I use this code but if you have something better....
var me = this;
Ext.device.Camera.capture({
success: function(image) {
me.add({
xtype:'image', // Commento
src: image
});
},
source: 'camera',
cameraDirection: navigator.camera.Direction.FRONT,
destination: 'file'bu
});
thank you
Carlo
Sencha documentation got an example for it. See http://docs.sencha.com/touch/2.3.1/#!/api/Ext.device.Camera
Ext.device.Camera.capture({
success: function(image) {
imageView.setSrc(image);
},
quality: 75,
width: 200,
height: 200,
destination: 'data'
});
You can also use
destination: 'url'
in that case the image argument of the callback function will be a file URL what you can use in a container template as the source of the html image.

Load data into detailed view from list sencha touch 2 MVC

I'm trying to use .setActiveItem to display detailed info on items in a listview (Ext.dataview.List) in a Sencha 2.1 MVC app. The problem is that I can't get the detailed view to load the data.
I've tried many different methods of getting the detailed view to show data including setData, setRecord and Update (see below for some of my latest tries).
Most of the results I keep getting when searching the forums, stackoverflow and google are for sencha apps not using the MVC model.
(Oh, using .push this works fine but due to other reasons I'm moving away from the navigation view).
From my controller:
showDetail: function(list, record) {
/*this.getMain().push({
xtype: 'labdetail',
title: record.fullName(),
data: record.getData()
});*/
//The code above works, but only as long as I stay with navigation view...
console.log("showDetail");
//Ext.getCmp('labdetail').update(record.data);
//LabDetail.update(record.data);
//Ext.fly('labdetail').setData(record.data);
//Ext.getCmp('labdetail').setData(record.data);
//Ext.component('Labblistan.view.LabDetail').destroy();
//Ext.getCmp('Labblistan.view.LabDetail').destroy();
//Ext.fly('labdetail').destroy();
//var DetailView = Ext.create('Labblistan.view.LabDetail'); //If I create the view the console complains I need to destroy previous views with the same ID, hence the different destroy() approaches above
//DetailView.setRecord(record);
Ext.getCmp('mainpanel').setActiveItem('labdetail'); //This navigates to the right view, but it's empty
},
My detailview:
Ext.define('Labblistan.view.LabDetail', {
extend: 'Ext.Panel',
xtype: 'labdetail',
id: 'labdetail',
config: {
title: '{Analysis}',
styleHtmlContent: true,
scrollable: 'vertical',
fullscreen: true,
tpl: [
'<div style=position:absolute;top:50px;><p>Info about {Analysis}</p><p>{Comment}</p></div>'
],
},
});
Don't know if this is best practice but this is how I got it working:
Ext.getCmp('mainpanel').setActiveItem({
xtype: 'labdetail',
title: 'Detaljinformation',
data: record.getData()
});

How to take a photo using Camera in Sencha App?

I am trying to take a picture using camera in Sencha Touch 2. Here i have one button 'Take a Picture', when i will press it, camera should start. As i am new to this sencha touch 2, i am unable to figure it out, how to do this?
For this i used the below code:
Sencha Fiddle Link
Please help me. I do not want to use Phone gap.
You have to add device folder of Sencha Library in root directory
and add below code in
Ext.require('Ext.device.Camera');
and use this code for capture image using camera
Ext.device.Camera.capture({
success: function(image) {
imageView.setSrc(image);
},
quality: 75,
width: 200,
height: 200,
destination: 'data'
});
If you want to use purely sencha, then you can check this code:
xtype: 'button',
handler: function(button, event) {
Ext.device.Camera.capture({
source: 'camera',
destination: 'data',
success: function(imagedata) {
var img = Ext.getCmp('theimage');
img.setSrc('data:image/jpeg;base64,' +imagedata);
},
failure: function() {
Ext.Msg.alert('Error', 'There was an error when acquiring the picture.');
},
scope: this
});
But if you want to use phonegap camera features, may be you have to change the code. As sencha is giving the default feature to handle the camera, i wish not to go with phonegap. Hope it will help..

Using XTempate with Sencha Touch 2

So working though the mostly absent docs on templates - unable to get it to work.
Ext.define('MyAPp.view.Login', {
extend: 'Ext.Component',
xtype: 'welcomeLogin',
config: {
html: 'This shows',
tpl: Ext.create ('Ext.XTemplate', '<div>Please show something</div>', {
compiled: true
})
}
});
Why does the template content now show? I have tried adding apply(), applyTemplate() on and on and on... Please help!!!
#ilija139 is right.
you need to define the data property, even if it's empty.
data: {}
Edit:
Also, the compile attribute isn't needed. It only applies to Ext.Templates not XTemplates (according to the docs). Works the same for me without compile