How to replace getColumnModel() function - EXTJS 4 - extjs4

I'm new to EXTJS. I didn't find getColumnModel() in EXTJS4.
Here is my code snippet:
grid.getColumnModel().on('hiddenchange', this.verifyLayout, this, {delay:1});
How can I replace the same in EXTJS 4?
Can anyone help me in this?
Thanks in advance!
Rahul.

In Ext JS 4 Ext.grid.Panel have columnhide and columnshow events which you can use instead of Ext JS 3 Ext.grid.ColumnModel hiddenchange event.
So you can rewrite your code like this:
grid.on('columnhide', this.verifyLayout, this, {delay:1});
grid.on('columnshow', this.verifyLayout, this, {delay:1});
Also if your verifyLayout method process event parameters you will have to modify it.

Related

How to use findElementsByIosNsPredicate?

Appium 1.6
IOS9.3
I used to find iOS element like:
findElementByIosUIAutomation(".tableViews()[0].cells()[1].collectionViews()[0].cells()[0]")
But in XCUITest, how to use findElementsByIosNsPredicate like that? How to write the predicate string ?
Please help me !
Probably, you can try to use something like:
XCUIApplication().tables.element(boundBy: 0).cells.element(boundBy: 1).collectionViews.element(boundBy: 0).cells.element(boundBy: 0)
But I strongly recommend adding accessibilityIdentifier to the UI elements and use it directly:
XCUIApplication().cells["cellAccessibilityIdentifier"]

How to initialize Materializecss form elements at run time?

I am adding form input elements at runtime, and i am using materializecss. text inputs do not render properly and I am guessing that they need to be initialized in javascript same as select or paralax. ex: ('.parallax').parallax(); , $(".select").material_select();
Is there an equivelent for form inputs for instance something like?
$('.parallax').material_input();?
Found a solution that works for me: Materialize.updateTextFields();

Sencha Touch 2 Field Focus

Does anyone know the Sencha Touch 2 equivalent of ExtJS4's:
form.getForm().findField("myfield");
Thanks.
use form.getValues(); assuming you can get the form element... if you needs to do that use refs... on my mobile rigjt now, i can post more sample code later if necessary
I use that way:
var field = vorm.down("textfield[name=username]");
Example:
form.down("selectfield[name=username]").setLabel('User');
form.down("selectfield[name=username]").setValue('email#te');
form.down("selectfield[name=username]").setPlaceHolder('email#test.com');

Setting datepicker element in Zend_config_Ini

I am trying to create form element using Zend_Config_Ini. Among other elements, I have a datepicker element (zendx_jquery_form_element_datepicker) which fails to work.
I have tried setting the element like so:
user.login.elements.Date.type = "datePicker"
and
user.login.elements.Date.type = "zendx_jquery_form_element_datepicker"
either way ends in the same error message:
Plugin by name 'Zendx_jquery_form_element_datepicker' was not found in the registry; used paths: Zend_Form_Element_: Zend/Form/Element/
or
Plugin by name 'DatePicker' was not found in the registry; used paths: Zend_Form_Element_: Zend/Form/Element/
Please help, thanks.
Just add prefix path before form config
$form = new Zend_Form();
$form->addPrefixPath('ZendX_JQuery_Form_Element', 'ZendX/JQuery/Form/Element', 'element');
$form->setConfig($config->form);
Try
user.login.elements.Date.type = "DatePicker"
The class name is class
ZendX_JQuery_Form_Element_DatePicker
I dont know how to make form using ini file. But I know Zendx_jquery_form_element_datepicker is not standed zend form element. It is make by ZendX. So you cant use it as zend element.

JUI Autocomplete html-encoded suggestions

jQuery UI starting from version 1.8.4 html-encodes Autocomplete suggestions (according to this issue).
This became a problem for me now. I used to theme the output for the suggestions, but now (if I use version 1.8.4 or higher) Autocomplete just html-encodes my theming. All tags like <b>, <span> are being printed to the user instead of displaying the actual styling.
So the suggestions now look like:
<b>su<b>suggestion
another <b>su<b>suggestion
instead of:
suggestion
another suggesion
I've read about custom data, but I use Yii framework and the output is being generated from certain actions (PHP code).
So, how do I theme the output now?
Thank you!
Better use a HTML plugin
You can use open function from jQuery UI to replace the encoded text.
Here's an example:
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'name'=>"bug",
'source'=>$this->createUrl('/autocomplete'),
// additional javascript options for the autocomplete plugin
'options'=>array(
'open'=> 'js:function(event, ui){
$("ul.ui-autocomplete li a").each(function(){
var htmlString = $(this).html().replace(/</g, "<");
htmlString = htmlString.replace(/>/g, ">");
$(this).html(htmlString);
});
}'
),
));