minDate in datepicker while inline editing of jqgrid

Fas

I have two jqgrids. On select of any row from 1st grid my 2nd grid is getting loaded. I want to edit the 2nd grid (using inline edit). There is a column "voucherDate" in 2nd grid and "loanReason" in 1st grid. Datepicker is used to edit voucherDate column.

Now what I want is to set minDate property in this datepicker and the minDate should be "loanReason" of 1st grid. I am not able to achieve this. Below is some code snippet.

ColModel of 2nd grid

{name : 'voucherDate', index : 'voucher_date',width : 150, align: "center", editable : true, editoptions:{size:20, 
                      dataInit:function(el){ 
                            $(el).datepicker({
                                dateFormat:'dd-M-yy',
                                changeMonth: true,
                                changeYear: true,
                                numberOfMonths: 1,
                                maxDate : '${currentDate}'
                                }); 
                      }},  
                    search : true, searchoptions: { dataInit: repaymentDateSearch, sopt: ['eq','cn'] }, sortable : true }

ColModel of 1st Grid

{name : 'loanReason', index : 'tcl.loan_date',width : 130, align: "center", 
                     searchoptions: { dataInit: initDateSearch, sopt: ['cn'] },
                     editable : true, editoptions : {readonly : 'readonly'}
}

I was trying to do this by using the below code(cboLoanEditList is 1st grid's name) in minDate property of datepicker, but this is not working :

var row = jQuery("#cboLoanEditList").jqGrid('getRowData',editedRow);
var loanDate = row.loanReason;
Fas

I got the answer. Find below code :

 {name : 'voucherDate', index : 'voucher_date',width : 150, align: "center", editable : true, editoptions:{size:20, 
                      dataInit:function(el){
                          var row = jQuery("#cboLoanEditList").jqGrid('getRowData',editedRow);
                            $(el).datepicker({
                                dateFormat:'dd-M-yy',
                                changeMonth: true,
                                changeYear: true,
                                numberOfMonths: 1,
                                maxDate : '${currentDate}',
                                minDate : row.loanDate
                                }); 
                      }},  
                    search : true, searchoptions: { dataInit: repaymentDateSearch, sopt: ['eq','cn'] }, sortable : true }

Instead of writing that jquery line directly inside minDate, I wrote it before the datepicker starts and it just worked like a charm.

What Paulo Diogo suggested was correct but that was from a textbox and not from grid which I wanted. Anyway thanks Paulo Diogo for replying. :)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

DatePicker input minDate maxDate

From Dev

Kendo UI MVC Grid I cannot use a datepicker while editing

From Dev

Issue with jqGrid with dynamic colModel while editing rows

From Dev

Display only datepicker in kendo inline editing not datetime picker

From Dev

jqgrid - save data for inline editing

From Dev

set datepicker mindate with jquery

From Dev

How to make element sizes to fill cell sizes and increase font in free jqgrid inline and form editing

From Dev

Setting Mindate and MaxDate for Datepicker Control

From Dev

jqGrid - Select selected cell's text while inline editing

From Dev

how to implement autocomplete dropdownlist in inline JqGrid editing

From Dev

jqgrid - inline editing, post only changed data

From Dev

Bootstrap 3 datepicker - minDate and maxDate

From Dev

get the defaultValue of textbox in jqgrid while on inline-edit

From Dev

DatePicker input minDate maxDate

From Dev

How to disable Save Handler on Jqgrid while doing editing

From Dev

How to set minDate in datepicker

From Dev

Issue with jqGrid with dynamic colModel while editing rows

From Dev

Display only datepicker in kendo inline editing not datetime picker

From Dev

jqGrid - how to focus cell inline editing

From Dev

How to add a datepicker and edit inline in jqGrid in MVC?

From Dev

How to make element sizes to fill cell sizes and increase font in free jqgrid inline and form editing

From Dev

JQGrid remove cell value from custom error message in inline editing

From Dev

minDate in datepicker while inline editing of jqgrid

From Dev

How to get Select's text from jqGrid column with inline editing

From Dev

Setting Mindate and MaxDate for Datepicker Control

From Dev

how to implement autocomplete dropdownlist in inline JqGrid editing

From Dev

Setting minDate on datepicker in javascript

From Dev

jqGrid: confirm dialog before submit in inline editing?

From Dev

jqgrid inline edit not working with datepicker column

Related Related

  1. 1

    DatePicker input minDate maxDate

  2. 2

    Kendo UI MVC Grid I cannot use a datepicker while editing

  3. 3

    Issue with jqGrid with dynamic colModel while editing rows

  4. 4

    Display only datepicker in kendo inline editing not datetime picker

  5. 5

    jqgrid - save data for inline editing

  6. 6

    set datepicker mindate with jquery

  7. 7

    How to make element sizes to fill cell sizes and increase font in free jqgrid inline and form editing

  8. 8

    Setting Mindate and MaxDate for Datepicker Control

  9. 9

    jqGrid - Select selected cell's text while inline editing

  10. 10

    how to implement autocomplete dropdownlist in inline JqGrid editing

  11. 11

    jqgrid - inline editing, post only changed data

  12. 12

    Bootstrap 3 datepicker - minDate and maxDate

  13. 13

    get the defaultValue of textbox in jqgrid while on inline-edit

  14. 14

    DatePicker input minDate maxDate

  15. 15

    How to disable Save Handler on Jqgrid while doing editing

  16. 16

    How to set minDate in datepicker

  17. 17

    Issue with jqGrid with dynamic colModel while editing rows

  18. 18

    Display only datepicker in kendo inline editing not datetime picker

  19. 19

    jqGrid - how to focus cell inline editing

  20. 20

    How to add a datepicker and edit inline in jqGrid in MVC?

  21. 21

    How to make element sizes to fill cell sizes and increase font in free jqgrid inline and form editing

  22. 22

    JQGrid remove cell value from custom error message in inline editing

  23. 23

    minDate in datepicker while inline editing of jqgrid

  24. 24

    How to get Select's text from jqGrid column with inline editing

  25. 25

    Setting Mindate and MaxDate for Datepicker Control

  26. 26

    how to implement autocomplete dropdownlist in inline JqGrid editing

  27. 27

    Setting minDate on datepicker in javascript

  28. 28

    jqGrid: confirm dialog before submit in inline editing?

  29. 29

    jqgrid inline edit not working with datepicker column

HotTag

Archive