Click here to Skip to main content
15,887,083 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionClick function not working the first time Pin
KokDavy27-Oct-14 1:43
KokDavy27-Oct-14 1:43 
Questionjavascript certification study pal Pin
Member 1117229022-Oct-14 3:13
Member 1117229022-Oct-14 3:13 
QuestionJQGrid and MIT license Pin
Sibeesh KV9-Oct-14 19:20
professionalSibeesh KV9-Oct-14 19:20 
AnswerRe: JQGrid and MIT license Pin
Richard Deeming9-Oct-14 22:52
mveRichard Deeming9-Oct-14 22:52 
GeneralRe: JQGrid and MIT license Pin
Sibeesh KV12-Oct-14 23:40
professionalSibeesh KV12-Oct-14 23:40 
AnswerRe: JQGrid and MIT license Pin
Sunasara Imdadhusen12-Oct-14 23:32
professionalSunasara Imdadhusen12-Oct-14 23:32 
GeneralRe: JQGrid and MIT license Pin
Sibeesh KV12-Oct-14 23:40
professionalSibeesh KV12-Oct-14 23:40 
Questiondropdown edit type selection to read mode for few records. Pin
parkway9-Oct-14 7:06
parkway9-Oct-14 7:06 
hi,
I have a requirement in the jqgrid data that totally 3 columns in that one is name,date and one column called department where the edit type is select have two options education and humanresources.

for some records like up to this month 10/31 the records should be editable , i mean we can select some thing and we can update. only the current month should be editable and next month data should not editable we can view it but not edit just like should be in read mode.


How to approach this scenario?





$("#grid").jqGrid({
url: 'Handler.ashx',
datatype: 'json',
height: 250,
colNames: ['Name','Department', 'Date'],
colModel: [
{ name: 'Name', index: 'Name', width: 256, stype: 'text', editable: true, sortable: false, editoptions: { disabled: "disabled"} },
{ name: 'Department', index: 'Department', width: 256, stype: 'text', sortable: false, editable: true, edittype: 'select',
formatter: rowColorFormatter,
editoptions: { value: "Education:Education; Humanresource:Humanresource" }},
{ name: 'Date', index: 'Date', width: 256, editable: true, stype: 'text', sortable: true, sorttype: 'date', editoptions: { disabled: "disabled"} }
],
rowNum: 100,
loadonce: true,
rowList: [100, 200, 300],
pager: '#pager',
sortname: 'name',
viewrecords: true,
sortorder: 'asc',
gridview: true,
ignoreCase: true,
caseSensitive: false,
rownumbers: true,
reloadAfterSubmit: false,
width: 1024,
gridComplete: function() {
for (var i = 0; i < rowsToColor.length; i++) {
var Department = $("#" + rowsToColor[i]).find("td").eq(2).html();
if (Department == "Humanresource") {
$("#" + rowsToColor[i]).find("td").css("background-color", "red");
}
}
},
jsonReader: {
repeatitems: false
},
caption: 'Department Update',
editurl: 'Handler.ashx',
onSelectRow: function(id) {
if (id && id !== lastSelectedId) {
$('#grid').restoreRow(lastSelectedId);
$('#grid').editRow(id, true);
lastSelectedId = id;
}


},

afterSubmit: function() {

$(this).jqGrid("setGridParam", { datatype: 'json' });
return [true];
alert("returnvalue");
}

});

function rowColorFormatter(cellValue, options, rowObject) {
if (cellValue == "Humanresources")
rowsToColor[rowsToColor.length] = options.rowId;
return cellValue;
};


$("#grid").setGridParam({ sortname: 'CalDate', sortorder: 'asc' }).trigger('reloadGrid');

$("#grid").jqGrid('navGrid', '#pager',
{
edit: false,
add: false,
del: false,
search: true,
searchtext: "Search",
reloadAfterSubmit: true,
cloneToTop: true,
overlay: false,
beforeRefresh: function() {
$("#grid").setGridParam({ datatype: 'json', page: 1 }).trigger('reloadGrid');

}
}


});



$("#grid").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: true, defaultSearch: "cn" }).navButtonAdd('#pager', {
caption: "Export to Excel",
buttonicon: "ui-icon-disk",
onClickButton: function() {
ExportDataToExcel("#grid");
},
position: "last"
});





$("#grid").jqGrid('editRow', {

aftersavefunc: function() {

onEnterrowdetails('#list');

}


});
});


function ExportDataToExcel(tableCtrl) {

ExportJQGridDataToExcel(tableCtrl, "MKS.xlsx");

}
function onEnterrowdetails() {
$('#<%=lblMessage.ClientID%>').html(" Data Updated");
return true;
}
</script>





</form>
</body>
</html>
QuestionCross domain SOAP call (with XmlHttpRequest) to a webservice with windows authentication Pin
michielke8-Oct-14 22:12
michielke8-Oct-14 22:12 
Questionhow to display timer starting from 0 minutes and increment further Pin
Member 105573645-Oct-14 1:08
Member 105573645-Oct-14 1:08 
SuggestionRe: how to display timer starting from 0 minutes and increment further Pin
Kornfeld Eliyahu Peter5-Oct-14 1:15
professionalKornfeld Eliyahu Peter5-Oct-14 1:15 
QuestionJavascript and arrays Pin
Member 1111635128-Sep-14 16:32
Member 1111635128-Sep-14 16:32 
SuggestionRe: Javascript and arrays Pin
Kornfeld Eliyahu Peter28-Sep-14 20:58
professionalKornfeld Eliyahu Peter28-Sep-14 20:58 
QuestionJavascript and arrays Pin
Member 1111635128-Sep-14 16:30
Member 1111635128-Sep-14 16:30 
AnswerRe: Javascript and arrays Pin
Kornfeld Eliyahu Peter28-Sep-14 21:00
professionalKornfeld Eliyahu Peter28-Sep-14 21:00 
AnswerRe: Javascript and arrays Pin
Richard MacCutchan28-Sep-14 22:07
mveRichard MacCutchan28-Sep-14 22:07 
GeneralRe: Javascript and arrays Pin
Sunasara Imdadhusen12-Oct-14 23:34
professionalSunasara Imdadhusen12-Oct-14 23:34 
Questionckeditor, custom dialog, element ID's are different from Firefox and IE Pin
jkirkerx24-Sep-14 10:28
professionaljkirkerx24-Sep-14 10:28 
QuestionJQuery,JavaScript,Angular JS Pin
Sibeesh KV23-Sep-14 19:05
professionalSibeesh KV23-Sep-14 19:05 
AnswerRe: JQuery,JavaScript,Angular JS Pin
Vindhyachal_Kumar24-Sep-14 1:23
professionalVindhyachal_Kumar24-Sep-14 1:23 
GeneralRe: JQuery,JavaScript,Angular JS Pin
Sibeesh KV24-Sep-14 1:40
professionalSibeesh KV24-Sep-14 1:40 
AnswerRe: JQuery,JavaScript,Angular JS Pin
thatraja24-Sep-14 2:40
professionalthatraja24-Sep-14 2:40 
GeneralRe: JQuery,JavaScript,Angular JS Pin
ZurdoDev24-Sep-14 3:15
professionalZurdoDev24-Sep-14 3:15 
GeneralRe: JQuery,JavaScript,Angular JS Pin
Sunasara Imdadhusen12-Oct-14 23:35
professionalSunasara Imdadhusen12-Oct-14 23:35 
GeneralRe: JQuery,JavaScript,Angular JS Pin
Sibeesh KV24-Sep-14 3:28
professionalSibeesh KV24-Sep-14 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.