try below in the grid column
$this->addColumn('position', array( 'header' => Mage::helper('postcard')->__('Position'), 'align' =>'left', 'index' => 'position', 'type' => 'input', 'width' => '100', 'sortable' => true, 'editable' => 'true', 'inline_css' => "my-grid-input-text",
Your input will be editable, but you will not be able to publish these values. To post editable values add javasctipt below to overwrite default function
varienGridMassaction.prototype.apply = function() { if(varienStringArray.count(this.checkedString) == 0) { alert(this.errorText); return; } var item = this.getSelectedItem(); if(!item) { this.validator.validate(); return; } this.currentItem = item; var fieldName = (item.field ? item.field : this.formFieldName); var fieldsHtml = ''; if(this.currentItem.confirm && !window.confirm(this.currentItem.confirm)) { return; } this.formHiddens.update(''); new Insertion.Bottom(this.formHiddens, this.fieldTemplate.evaluate({name: fieldName, value: this.checkedString})); new Insertion.Bottom(this.formHiddens, this.fieldTemplate.evaluate({name: 'massaction_prepare_key', value: fieldName})); // collect all inputs of grid to post it new Insertion.Bottom(this.formHiddens, this.fieldTemplate.evaluate({name: 'form_inputs', value: Form.serializeElements($$('#'+this.grid.containerId + ' .grid input'))})); if(!this.validator.validate()) { return; } if(this.useAjax && item.url) { new Ajax.Request(item.url, { 'method': 'post', 'parameters': this.form.serialize(true), 'onComplete': this.onMassactionComplete.bind(this) }); } else if(item.url) { if(item.target) { switch(item.target){ case '_blank': this.form.target = '_blank'; break; default: this.form.target = ''; break; } } this.form.action = item.url; this.form.submit(); this.form.target = ''; } };
and in the controller file get your inputs
$postData = $this->getRequest()->getParams(); if(isset($postData['form_inputs'])) { parse_str($postData['form_inputs'],$formInputs); echo "<pre>"; print_r($formInputs); }
source share