(KIVY) Using accordion as a side menu - accordion

So I am trying to make a side menu with accordion, and have a carousel with text input beside it. But, the accordion stays open. I want it to start closed, then upon click it opens, then click the accordion and it closes again. But how?
Here's my code:
BoxLayout:
padding: 0, 40
id: spacetext
Accordion:
size_hint_x: .8
AccordionItem:
title: 'All your Notes'
Label:
text: 'List of notes'
Carousel:
loop: False
#size_hint_x: .85
ScrollView:
id: scrlv
size_hint_x: 1
TextInput:
size_hint: 1, None
height: max(self.minimum_height, scrlv.height)
ScrollView:
id: scrlv
size_hint_x: 1
TextInput:
size_hint: 1, None
height: max(self.minimum_height, scrlv.height)
ScrollView:
id: scrlv
size_hint_x: 1
TextInput:
size_hint: 1, None
height: max(self.minimum_height, scrlv.height)
ScrollView:
id: scrlv
size_hint_x: 1
TextInput:
size_hint: 1, None
height: max(self.minimum_height, scrlv.height)
Only for kivy language, I have the python too but as of now it does not use this.
Thanks :)

I suggest using the NavigationDrawer widget from the kivy garden. You can put the accordion in the drawer, and manually toggle the opening and closing.

Related

AEM6: Aligning radio selection labels to left

I am creating a component which has a couple radio buttons. Currently the radio button label is on the right of each button, I want it on the left. How can do that ?
Using the boxLabelAlign config.
{
xtype: 'radiofield',
anchor: '100%',
fieldLabel: 'Label',
boxLabel: 'Box Label',
boxLabelAlign: 'before'
}

How to disable certain rows in grid in Extjs 4.2

I have a grid with two checkcolumns and a text field
{
xtype: 'checkcolumn',
id: 'apprId',
text: '<b>Approve</b>',
width: 100,
dataIndex: 'aprvInd'
},
{
xtype: 'checkcolumn',
id: 'declId',
text: '<b>Decline</b>',
width: 100,
dataIndex: 'declInd'
},
{
id: 'declResnId',
header: '<b>Decline Reasons</b>',
dataIndex: 'declineReason',
align: 'center',
width: 200,
editor: new Ext.form.TextField({
maxLength: 100000
}),
}
if my grid has three rows, first row 'approve' checkbox checked, second row 'decline' checkbox checked and third row nothing checked.
on click of save button, i am doing a rest call and i m passing the data to db, and on success call back , i m reloading grid.
After reloading, the rows which have approve/decline checked should be disabled along with the 'declineReasons' text field.
How can i do this?
If you want to grey out the row I would look at the metaData parameter of the renderer config. Probably the trCls is referenced there.
To disable a checkbox I also would look at the renderer.
To disable the editor plugin look at the beforeedit event.

How to animate ExtJs window from top right of browser?

this.changePasswordWin = Ext.create('Ext.window.Window', {
title: "Change Password",
modal: true,
closeAction: 'hide',
animateTarget: Ext.getDoc(),
items: [ this.textfieldPanel ],
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
border: false,
}]
});
The above code is working fine with animate from top left. But i want this to animate from top right. Help me! Thanks in advance.
set x: screen.width. It will set the position of the window to the right corner. if it is not exactly minus the position based on the browser screen.

Restrict drag and drop in ExtJs tree panel

I developed two tree panels in ExtJs (Tree-1 and Tree-2). These trees are working with drag and drop in between two of them in all the cases. I want drag and drop in the following cases
(From Tree-1 to Tree-2), (From Tree-1 to Tree-1) and (From Tree-2 to Tree-2) only. That is want to restrict drag and drop from Tree-2 to Tree-1. The following is my source code.
/*Tree1*/
Ext.create('Ext.tree.Panel', {
title: 'From Agent:',
collapsible: true,
collapseDirection: Ext.Component.DIRECTION_TOP,
frame:true,
width: 310,
minHeight: 50,
margin: '0 0 0 0',
store: store1,
listeners:{
checkchange:function( node, checked, eOpts){
node.cascadeBy(function(n){n.set('checked', checked);} );
}
},
rootVisible: false,
viewConfig: {
plugins: {
ptype: 'treeviewdragdrop',
sortOnDrop: true,
containerScroll: true
}
},
sorters: [{
property: 'text',
direction: 'ASC'
}]
}),
/*Tree2*/
Ext.create('Ext.tree.Panel', {
title: 'To Agent:',
frame: true,
collapsible: true,
collapseDirection: Ext.Component.DIRECTION_TOP,
width: 310,
margin: '0 0 0 20',
minHeight: 50,
store: store2,
listeners:{
checkchange:function( node, checked, eOpts){
node.cascadeBy(function(n){n.set('checked', checked);} );
}
},
rootVisible: false,
viewConfig: {
plugins: {
ptype: 'treeviewdragdrop',
sortOnDrop: true,
containerScroll: true
}
},
sorters: [{
property: 'text',
direction: 'ASC'
}]
}),
These codes are working as cut and paste while drag and drop. I want to make these code as copy and paste while drag and drop. Please, help me.
Thanks in advance.
Take a look at this example from the docs:
http://docs.sencha.com/extjs/4.2.2/extjs-build/examples/tree/custom-drop-logic.html
Basically it uses nodedragover event to control when one can drop or not.
Return false when you don't want to allow the drop.
As far as making it copy instead of cutting, the documentation mentions the following (although I've never tried it myself):
This plugin provides drag and/or drop functionality for a TreeView.
It creates a specialized instance of DragZone which knows how to drag
out of a TreeView and loads the data object which is passed to a
cooperating DragZone's methods with the following properties:
copy : Boolean
The value of the TreeView's copy property, or true if the TreeView was
configured with allowCopy: true and the control key was pressed when
the drag operation was begun.
Try setting copy: true to the two views.

Sencha Touch: how to add a table view as rootView in left side & a view with a button as detailsView in right side of this split view in sencha touch

I have implemented an app in iphone using sencha touch & phone gap.
Implemented split view using following code in index.js in SRC file with two text messages.. as shown bellow figure
Now i need to add a table view on left side root view and a button on right side details view. how?
Thanks in advance
Ext.ns('sink', 'demos', 'Ext.ux');
Ext.ux.UniversalUI = Ext.extend(Ext.Panel,
{
fullscreen: true,
layout: 'hbox',
items:
[
//Root view
{
xtype: 'panel',
html: 'TableView/Rootview goes here ...',
flex: 1
},
//Details view
{
xtype: 'panel',
html: 'Message Detail view goes here ....',
flex: 2
}
]
});
Currently your rootView and detailView are all of xtype: 'panel'. To achieve what you need, you have to modify a little bit to those 2 items:
For the root view, actually it's called GridView, please read this for more details: http://www.sencha.com/forum/showthread.php?150431-Ext.ux.touch.grid
For the detail view, it's simple to create a view with a button, for example (just example, might not exactly be what you need):
{
xtype: 'container',
items: [
{xtype: 'button', text: 'my button'},
{xtype: 'panel', text: 'detail panel'}.
]
}