jQWidgets Forums
Forum Replies Created
-
Author
-
November 21, 2012 at 1:02 pm in reply to: Custom sort option and Grid Sorting option disable for single comumn Custom sort option and Grid Sorting option disable for single comumn #11304
Hi Peter,
Please help me
To disable the sorting and filtering of a column, i have set the column’s sortable and filterable properties to false.
But when i mover hover on the column, filter icon is still visible.. How to hide the filter icon??
Hi Peter Stoev,
The above code with i have sent you was for edit popup.
Please help me..
Here is the code behind .cs file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using System.Web.Script.Services;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;namespace WebApplication1
{
public partial class PopUpJQ : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{}
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Xml)]
public static string GetCustomers()
{
string query = “SELECT * FROM HFCL_Users”;
SqlCommand cmd = new SqlCommand(query);
// Populate the DataSet.
DataSet data = GetData(cmd);
// return the Customers table as XML.
System.IO.StringWriter writer = new System.IO.StringWriter();
data.Tables[0].WriteXml(writer, XmlWriteMode.WriteSchema, false);
return writer.ToString();
}
private static DataSet GetData(SqlCommand cmd)
{
string strConnString = ConfigurationManager.ConnectionStrings[“HFCLDataConnectionString”].ConnectionString;
using (SqlConnection con = new SqlConnection(strConnString))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataSet ds = new DataSet())
{
sda.Fill(ds);
return ds;
}
}
}
}
public string Update(string data)
{
return “1”;
}
}
}Hi Peter,
Please help me with the update command and i need selected rowid of the table but not the selected Grid row id.
Below is my code.
html xmlns=”http://www.w3.org/1999/xhtml”>PopUp Editing
$(document).ready(function () {
var theme = getTheme();
//Getting the source data with ajax GET request {name: ‘RowID’},
source = {
datatype: “xml”,
datafields: [
{ name: ‘FirstName’ },
{ name: ‘LastName’ },
{ name: ‘State’ },
{ name: ‘City’ },
{ name: ‘EmailID’ },
{ name: ‘MobileNumber’ },
{ name: ‘Edit’ }
],
id: ‘RowID’,
async: false,
record: ‘Table’,
url: ‘PopUpJQ.aspx/GetCustomers’,
updaterow: function (editrow, rowdata) {
// Here i am facing the problem while sending data to server.
var data = $.param(rowdata);
$.ajax({
dataType: ‘json’,
url: ‘PopUpJQ.aspx/Update’,
data: data,
success: function (data, status, xhr) {
// update command is executed.
commit(true);
}});
}
};
$(“#firstName”).addClass(‘jqx-input’).width(150).height(23);
$(“#lastName”).addClass(‘jqx-input’).width(150).height(23);
$(“#state”).addClass(‘jqx-input’).width(150).height(23);
$(“#mobileNumber”).addClass(‘jqx-input’).height(23).width(150);
$(“#city”).addClass(‘jqx-input’).height(23).width(150);
$(“#emailID”).addClass(‘jqx-input’).height(23).width(150);
if (theme.length > 0) {
$(“#firstName”).addClass(‘jqx-input-‘ + theme);
$(“#lastName”).addClass(‘jqx-input-‘ + theme);
$(“#state”).addClass(‘jqx-input-‘ + theme);
$(“#mobileNumber”).addClass(‘jqx-input’ + theme);
$(“#city”).addClass(‘jqx-input’ + theme);
$(“#emailID”).addClass(‘jqx-input’ + theme);
}var editrow = -1;
var dataAdapter = new $.jqx.dataAdapter(source,
{ contentType: ‘application/json; charset=utf-8’ }
);$(“#jqxgrid”).jqxGrid({
source: dataAdapter,
theme: ‘classic’,
filterable: true,
sortable: true,
pageable: true,
autoheight: true,columns: [
{ text: ‘First Name’, dataField: ‘FirstName’, width: 90 },
{ text: ‘Last Name’, dataField: ‘LastName’, width: 90 },
{ text: ‘State’, dataField: ‘State’, width: 90 },
{ text: ‘MobileNumber’, dataField: ‘MobileNumber’, width: 90 },
{ text: ‘City’, dataField: ‘City’, width: 80 },
{ text: ‘EmailID’, dataField: ‘EmailID’, width: 90 },
{ text: ‘Edit’, datafield: ‘Edit’, columntype: ‘button’, cellsrenderer: function () {
return “Edit”;
}, buttonclick: function (RowID) {
// open the popup window when the user clicks a button.
editrow = RowID;var offset = $(“#jqxgrid”).offset();
$(“#popupWindow”).jqxWindow({ position: { x: parseInt(offset.left) + 60, y: parseInt(offset.top) + 60 }, width: 500 });
// get the clicked row’s data and initialize the input fields.
var dataRecord = $(“#jqxgrid”).jqxGrid(‘getrowdata’, editrow);
$(“#firstName”).val(dataRecord.FirstName);
$(“#lastName”).val(dataRecord.LastName);$(“#state”).val(dataRecord.State);
$(“#city”).val(dataRecord.City);
$(“#mobileNumber”).val(dataRecord.MobileNumber);$(“#emailID”).val(dataRecord.EmailID);
$(“#popupWindow”).jqxWindow(‘show’);
}
},
]
});
$(“#popupWindow”).jqxWindow({ width: 500, resizable: false, theme: theme, isModal: true, autoOpen: false, cancelButton: $(“#Cancel”), modalOpacity: 0.01 }); //
$(“#Cancel”).jqxButton({ theme: theme });
$(“#Save”).jqxButton({ theme: theme });
// update the edited row when the user clicks the ‘Save’ button.$(“#Save”).live(“click”, function () {
if (editrow >= 0) {
var row = { firstname: $(“#firstName”).val(), lastname: $(“#lastName”).val(), statename: $(“#state”).val(),
mobileNumber: $(“#mobileNumber”).val(), cityname: $(“#city”).val(), emailID: $(‘#emailID’).val()
};
$(‘#jqxgrid’).jqxGrid(‘updaterow’, editrow, row);
$(“#popupWindow”).jqxWindow(‘hide’);
}
});
$(‘#clearfilteringbutton’).jqxButton({ height: 25, theme: theme });
});EditFirst Name:
Last Name:
State:
MobileNumber:
City:
EmailID:
-
AuthorPosts