Inline Edition

Feb 8, 2013 at 12:47 AM
Tomazs Hello again, I'm having trouble using inline edition.
The error occurs here:
    var gridfc = new JqGridHelper<Estudio.WebUI.Models.FacturaRcModel>("detallefc",
        dataType: JqGridDataTypes.Json,
        editingUrl: Url.Action("UpdateDetalleFc"),
        methodType: JqGridMethodTypes.Post,
        pager: true,
        width: 900,
        rowsNumber: 10,
        sortingName: "FacturaId",
        sortingOrder: JqGridSortingOrders.Asc,
        parametersNames: new JqGridParametersNames { Id = "FacturaId" },
        url: Url.Action("ListFcByCliente","Facturas", new {clienteId = Model.ClienteId}),
        viewRecords: true
    ).AddActionsColumn("actions", inlineEditingOptions: new JqGridInlineNavigatorActionOptions { Keys = true }, deleteButton: false);
When adding the actions column in the first column of data is deleted

This is my model
   public class FacturaRcModel
    {
        [ScaffoldColumn(false)]
        public virtual int FacturaId { get; set; }
        [Required, DisplayName("Tipo Factura")]
        public virtual string TipoFactura { get; set; }
        [Required, DisplayName("Fecha Emisión"), DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
        public virtual DateTime Fecha { get; set; }
        [DisplayName("N° Comprobante"), Required]
        public virtual string NComprobante { get; set; }
        [Required, DisplayName("Importe Original")]
        [JqGridColumnLayout(Alignment = JqGridAlignments.Right)]
        [JqGridColumnFormatter(JqGridColumnPredefinedFormatters.Currency, DecimalPlaces = 2, DecimalSeparator = ".", Prefix = "$")]
        public virtual decimal Neto { get; set; }
        [Required, DisplayName("Saldo")]
        [JqGridColumnLayout(Alignment = JqGridAlignments.Right)]
        [JqGridColumnFormatter(JqGridColumnPredefinedFormatters.Currency, DecimalPlaces = 2, DecimalSeparator = ".", Prefix = "$")]
        public virtual decimal Saldo { get; set; }
        [JqGridColumnEditable(true, EditType = JqGridColumnEditTypes.CheckBox)]
        [DisplayName("Seleccionar")]
        public virtual string Seleccionar { get; set; }
        [Required, DisplayName("Importe")]
        [JqGridColumnLayout(Alignment = JqGridAlignments.Right)]
        [JqGridColumnFormatter(JqGridColumnPredefinedFormatters.Currency, DecimalPlaces = 2, DecimalSeparator = ".", Prefix = "$")]
        [JqGridColumnEditable(true, EditType = JqGridColumnEditTypes.Text)]
        public virtual decimal Importe { get; set; }
        [ScaffoldColumn(false)]
        public virtual int CobranzaId { get; set; }
    }
Example:
Image

What is wrong with my model?
Coordinator
Feb 8, 2013 at 7:18 AM
Hi,

Please check following discussion: http://tpeczek.codeplex.com/discussions/394464
Feb 8, 2013 at 1:38 PM
Great!

Another question, i need send extra param as part of ajaxData on Edit. In another question you suggested using ExtraDataScript as part of JqGridNavigatorEditActionOptions.

What is the solution here?
Feb 8, 2013 at 1:59 PM
I found the solution
.AddActionsColumn("actions", inlineEditingOptions: new JqGridInlineNavigatorActionOptions { Keys = true, ExtraParamScript = ...
Coordinator
Feb 8, 2013 at 2:08 PM
I'm happy that you have found that by yourself ;)
Feb 8, 2013 at 4:32 PM
TPeczek wrote:
I'm happy that you have found that by yourself ;)
Sorry

I have try this
AddActionsColumn("actions", inlineEditingOptions: new JqGridInlineNavigatorActionOptions() { Keys = true, ExtraParamScript = "{ cobranzaId : document.getElementById('CobranzaId').value }" }, deleteButton: false)
and this
AddActionsColumn("actions", inlineEditingOptions: new JqGridInlineNavigatorActionOptions() { Keys = true, ExtraParamScript = "guardarfc()" }, deleteButton: false);
Both methods fail.
in the first case the error is
SyntaxError: missing ) after argument list
[Break On This Error]   

false, sortable: false, width: 60, viewable: false, name: 'actions' },

1 (line 55, col 60)
    
In the second case this is the error
SyntaxError: invalid property id
[Break On This Error]   

{ hidden: true, name: 'FacturaId' },
What is wrong?
Feb 8, 2013 at 6:17 PM
Again, after try many times, this is the solution
editingUrl: Url.Action("UpdateDetalleFc", new { cobranzaId = Model.CobranzaId })
:)