سؤال

I want to use the following start with operand in jqGrid:

select * from lib where (mesc.substring(0,2) between 13 and 60)

In jqGrid I have just a start with but do not have a start with between, and I would like to add this operand to the search operand.

I have a lib table, and in the lib table I have a mesc field (datatype mesc is nvarchar(10)). In this table I save material information. I group records in the case when Mesc starts with 13 to 60, 6 to 70, and 80 to 90. Possibly the end user would want to see all materials that start with 13 to 16, or 13 to 60. I do not know how to implement this.

هل كانت مفيدة؟

المحلول

You can use two external <input> elements where the user can enter the value for mesc field and <button> "Search". You can send the values from the filed to the server with every refresh of the grid or by click on the "Search". See the answer for details.

You can alternatively use only one <input> element and allow the user to enter input in the form 13 - 60. In general you can implement any input options which you need like Sliders, Spinner and so on.

You can integrate the external input elements in the top toolbar of jqGrid if you what. See the answer for details.

In any way you can generate any SQL statement based on users input on the server side.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top